Package org.elasticsearch.common
Class ExponentiallyWeightedMovingAverage
- java.lang.Object
-
- org.elasticsearch.common.ExponentiallyWeightedMovingAverage
-
public class ExponentiallyWeightedMovingAverage extends java.lang.Object
Implements exponentially weighted moving averages (commonly abbreviated EWMA) for a single value. This class is safe to share between threads.
-
-
Constructor Summary
Constructors Constructor Description ExponentiallyWeightedMovingAverage(double alpha, double initialAvg)
Create a new EWMA with a givenalpha
andinitialAvg
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addValue(double newValue)
double
getAverage()
-
-
-
Constructor Detail
-
ExponentiallyWeightedMovingAverage
public ExponentiallyWeightedMovingAverage(double alpha, double initialAvg)
Create a new EWMA with a givenalpha
andinitialAvg
. A smaller alpha means that new data points will have less weight, where a high alpha means older data points will have a lower influence.
-
-