@InterfaceAudience.Private public class ExponentialMovingAverage<T> extends WindowMovingAverage<T>
WeightedMovingAverage
in weighted, but the weighting factor decrease
exponentially. It brings benefits that it is more sensitive, and can see the trends easily.DEFAULT_SIZE, lastN, mostRecent, oneRound
label
Constructor and Description |
---|
ExponentialMovingAverage(String label) |
ExponentialMovingAverage(String label,
double alpha) |
ExponentialMovingAverage(String label,
int size) |
ExponentialMovingAverage(String label,
int size,
double alpha) |
Modifier and Type | Method and Description |
---|---|
double |
getAverageTime()
Get average execution time of the measured method.
|
void |
updateMostRecentTime(long elapsed)
Update the most recent data.
|
enoughStatistics, getMostRecentPosition, getNumberOfStatistics, getStatisticsAtIndex, moveForwardMostRecentPosition
measure, start, stop
public ExponentialMovingAverage(String label)
public ExponentialMovingAverage(String label, double alpha)
public ExponentialMovingAverage(String label, int size)
public ExponentialMovingAverage(String label, int size, double alpha)
public void updateMostRecentTime(long elapsed)
MovingAverage
updateMostRecentTime
in class WindowMovingAverage<T>
elapsed
- elapsed time of the most recent measurementpublic double getAverageTime()
MovingAverage
getAverageTime
in class WindowMovingAverage<T>
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.