Package io.airlift.stats
Class ExponentialDecay
- java.lang.Object
-
- io.airlift.stats.ExponentialDecay
-
public final class ExponentialDecay extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static doublecomputeAlpha(double targetWeight, long targetAgeInSeconds)Compute the alpha decay factor such that the weight of an entry with age 'targetAgeInSeconds' is targetWeight'static doublefifteenMinutes()static doublefiveMinutes()static doubleoneMinute()static doubleseconds(int seconds)static doubleweight(double alpha, long now, long landmark)Compute the forward-decay multiplier (inverse of the decay factor)
-
-
-
Method Detail
-
oneMinute
public static double oneMinute()
-
fiveMinutes
public static double fiveMinutes()
-
fifteenMinutes
public static double fifteenMinutes()
-
seconds
public static double seconds(int seconds)
-
computeAlpha
public static double computeAlpha(double targetWeight, long targetAgeInSeconds)Compute the alpha decay factor such that the weight of an entry with age 'targetAgeInSeconds' is targetWeight'
-
weight
public static double weight(double alpha, long now, long landmark)Compute the forward-decay multiplier (inverse of the decay factor)
-
-