public class MovingAverageIntervalEstimator extends IntervalEstimator
| Modifier and Type | Field and Description |
|---|---|
protected AtomicLong |
count |
protected long[] |
intervalEndTimes |
protected int |
windowLength |
protected int |
windowMagnitude |
protected int |
windowMask |
| Constructor and Description |
|---|
MovingAverageIntervalEstimator(int requestedWindowLength) |
| Modifier and Type | Method and Description |
|---|---|
protected int |
getCurrentPosition() |
long |
getEstimatedInterval(long when)
Provides the estimated interval
|
void |
recordInterval(long when)
Record an interval
|
protected final long[] intervalEndTimes
protected final int windowMagnitude
protected final int windowLength
protected final int windowMask
protected AtomicLong count
public MovingAverageIntervalEstimator(int requestedWindowLength)
requestedWindowLength - The requested length of the moving window. May be rounded up to nearest power of 2.public void recordInterval(long when)
IntervalEstimatorrecordInterval in class IntervalEstimatorwhen - the end time (in nanoTime units) at which the interval was observed.public long getEstimatedInterval(long when)
IntervalEstimatorgetEstimatedInterval in class IntervalEstimatorwhen - the time (preferably now) at which the estimated interval is requested.protected int getCurrentPosition()
Copyright © 2015. All rights reserved.