public class RunningWindowAverage extends Object
| Constructor and Description |
|---|
RunningWindowAverage(int maxSamples,
int maxTime)
Construct a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getAverage()
Get average the ever-increasing value as the difference between the latest sample and some sample in the past,
divided by the two samples' time difference.
|
void |
sample(long time,
long value)
Take a sample.
|
public RunningWindowAverage(int maxSamples,
int maxTime)
maxSamples - maximum number of samples kept in the running window.maxTime - maximum amount of time span of the window.public void sample(long time,
long value)
time - at which the value was taken.value - sample value.public long getAverage()
Copyright © 2013-2016–2018 Graph Aware Limited. All rights reserved.