@InterfaceAudience.Private public class WeightedMovingAverage extends WindowMovingAverage
SimpleMovingAverage
, WeightedMovingAverage gives each data different
weight. And it is based on WindowMovingAverage
, such that it only focus on the last N.Modifier and Type | Field and Description |
---|---|
private int[] |
coefficient |
private int |
denominator |
DEFAULT_SIZE, lastN, mostRecent, oneRound
label
Constructor and Description |
---|
WeightedMovingAverage(String label) |
WeightedMovingAverage(String label,
int size) |
Modifier and Type | Method and Description |
---|---|
double |
getAverageTime()
Get average execution time of the measured method.
|
enoughStatistics, getMostRecentPosistion, getNumberOfStatistics, getStatisticsAtIndex, moveForwardMostRecentPosistion, updateMostRecentTime
measure, start, stop
private int[] coefficient
private int denominator
public WeightedMovingAverage(String label)
public WeightedMovingAverage(String label, int size)
public double getAverageTime()
MovingAverage
getAverageTime
in class WindowMovingAverage
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.