Package org.apache.hadoop.hbase.util
Class ExponentialMovingAverage<T>
java.lang.Object
org.apache.hadoop.hbase.util.MovingAverage<T>
org.apache.hadoop.hbase.util.WindowMovingAverage<T>
org.apache.hadoop.hbase.util.ExponentialMovingAverage<T>
EMA is similar to
WeightedMovingAverage in weighted, but the weighting factor decrease
exponentially. It brings benefits that it is more sensitive, and can see the trends easily.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleprivate doubleprivate doubleFields inherited from class org.apache.hadoop.hbase.util.WindowMovingAverage
DEFAULT_SIZE, lastN, mostRecent, oneRoundFields inherited from class org.apache.hadoop.hbase.util.MovingAverage
label -
Constructor Summary
ConstructorsConstructorDescriptionExponentialMovingAverage(String label) ExponentialMovingAverage(String label, double alpha) ExponentialMovingAverage(String label, int size) ExponentialMovingAverage(String label, int size, double alpha) -
Method Summary
Modifier and TypeMethodDescriptiondoubleGet average execution time of the measured method.(package private) doublevoidupdateMostRecentTime(long elapsed) Update the most recent data.Methods inherited from class org.apache.hadoop.hbase.util.WindowMovingAverage
enoughStatistics, getMostRecentPosition, getNumberOfStatistics, getStatisticsAtIndex, moveForwardMostRecentPositionMethods inherited from class org.apache.hadoop.hbase.util.MovingAverage
measure, start, stop
-
Field Details
-
alpha
-
previousAverage
-
currentAverage
-
-
Constructor Details
-
ExponentialMovingAverage
-
ExponentialMovingAverage
-
ExponentialMovingAverage
-
ExponentialMovingAverage
-
-
Method Details
-
updateMostRecentTime
Description copied from class:MovingAverageUpdate the most recent data.- Overrides:
updateMostRecentTimein classWindowMovingAverage<T>- Parameters:
elapsed- elapsed time of the most recent measurement
-
getAverageTime
Description copied from class:MovingAverageGet average execution time of the measured method.- Overrides:
getAverageTimein classWindowMovingAverage<T>- Returns:
- average time in ns
-
getPrevious
double getPrevious()
-