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
Modifier and TypeFieldDescriptionprivate double
private double
private double
Fields inherited from class org.apache.hadoop.hbase.util.WindowMovingAverage
DEFAULT_SIZE, lastN, mostRecent, oneRound
Fields inherited from class org.apache.hadoop.hbase.util.MovingAverage
label
-
Constructor Summary
ConstructorDescriptionExponentialMovingAverage
(String label) ExponentialMovingAverage
(String label, double alpha) ExponentialMovingAverage
(String label, int size) ExponentialMovingAverage
(String label, int size, double alpha) -
Method Summary
Modifier and TypeMethodDescriptiondouble
Get average execution time of the measured method.(package private) double
void
updateMostRecentTime
(long elapsed) Update the most recent data.Methods inherited from class org.apache.hadoop.hbase.util.WindowMovingAverage
enoughStatistics, getMostRecentPosition, getNumberOfStatistics, getStatisticsAtIndex, moveForwardMostRecentPosition
Methods 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:MovingAverage
Update the most recent data.- Overrides:
updateMostRecentTime
in classWindowMovingAverage<T>
- Parameters:
elapsed
- elapsed time of the most recent measurement
-
getAverageTime
Description copied from class:MovingAverage
Get average execution time of the measured method.- Overrides:
getAverageTime
in classWindowMovingAverage<T>
- Returns:
- average time in ns
-
getPrevious
double getPrevious()
-