@InterfaceAudience.Private public class WindowMovingAverage extends MovingAverage
Modifier and Type | Field and Description |
---|---|
protected static int |
DEFAULT_SIZE |
protected long[] |
lastN |
protected int |
mostRecent |
protected boolean |
oneRound |
label
Constructor and Description |
---|
WindowMovingAverage(String label) |
WindowMovingAverage(String label,
int size) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
enoughStatistics()
Check if there are enough statistics.
|
double |
getAverageTime()
Get average execution time of the measured method.
|
protected int |
getMostRecentPosistion() |
protected int |
getNumberOfStatistics() |
protected long |
getStatisticsAtIndex(int index)
Get statistics at index.
|
protected int |
moveForwardMostRecentPosistion()
Move forward the most recent index.
|
private long |
sum(int bound) |
protected void |
updateMostRecentTime(long elapsed)
Update the most recent data.
|
measure, start, stop
protected static final int DEFAULT_SIZE
protected long[] lastN
protected int mostRecent
protected boolean oneRound
public WindowMovingAverage(String label)
public WindowMovingAverage(String label, int size)
protected void updateMostRecentTime(long elapsed)
MovingAverage
updateMostRecentTime
in class MovingAverage
elapsed
- elapsed time of the most recent measurementpublic double getAverageTime()
MovingAverage
getAverageTime
in class MovingAverage
protected boolean enoughStatistics()
protected int getNumberOfStatistics()
protected long getStatisticsAtIndex(int index)
index
- index of barprotected int getMostRecentPosistion()
protected int moveForwardMostRecentPosistion()
private long sum(int bound)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.