Class ExponentiallyWeightedMovingAverage

java.lang.Object
org.elasticsearch.common.ExponentiallyWeightedMovingAverage

public class ExponentiallyWeightedMovingAverage extends Object
Implements exponentially weighted moving averages (commonly abbreviated EWMA) for a single value. This class is safe to share between threads.
  • Constructor Details

    • ExponentiallyWeightedMovingAverage

      public ExponentiallyWeightedMovingAverage(double alpha, double initialAvg)
      Create a new EWMA with a given alpha and initialAvg. 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.
  • Method Details

    • getAverage

      public double getAverage()
    • addValue

      public void addValue(double newValue)