Package io.airlift.stats
Class ExponentialDecay
java.lang.Object
io.airlift.stats.ExponentialDecay
-
Method Summary
Modifier and TypeMethodDescriptionstatic doublecomputeAlpha(double targetWeight, long targetAgeInSeconds) Compute the alpha decay factor such that the weight of an entry with age 'targetAgeInSeconds' is targetWeight'static doublestatic doublestatic doublestatic doubleseconds(int seconds) static doubleweight(double alpha, long now, long landmark) Compute the forward-decay multiplier (inverse of the decay factor)
-
Method Details
-
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)
-