@InterfaceAudience.Private public class WeightedMovingAverage<T> extends WindowMovingAverage<T>
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, getMostRecentPosition, getNumberOfStatistics, getStatisticsAtIndex, moveForwardMostRecentPosition, 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<T>
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.