public class ExponentialMovingAverageRate
extends java.lang.Object
increment()
when a new event occurs, and then use convenience methods (e.g. getMean()
)
to retrieve estimates of the rate of event arrivals and the statistics of the series. Older values are given
exponentially smaller weight, with a decay factor determined by a duration chosen by the client. The rate measurement
weights decay in two dimensions:
weight = exp((t0-t)/T)
where t0
is the
last measurement time, t
is the current time and T
is the lapse period)weight = exp(-i/L)
where L
is
the lapse window and i
is the sequence number of the measurement.Constructor and Description |
---|
ExponentialMovingAverageRate(double period,
double lapsePeriod,
int window) |
Modifier and Type | Method and Description |
---|---|
int |
getCount() |
double |
getMax() |
double |
getMean() |
double |
getMin() |
double |
getStandardDeviation() |
Statistics |
getStatistics() |
double |
getTimeSinceLastMeasurement() |
void |
increment()
Add a new event to the series.
|
void |
reset() |
java.lang.String |
toString() |
public ExponentialMovingAverageRate(double period, double lapsePeriod, int window)
period
- the period to base the rate measurement (in seconds)lapsePeriod
- the exponential lapse rate for the rate average (in seconds)window
- the exponential lapse window (number of measurements)public void reset()
public void increment()
public int getCount()
public double getTimeSinceLastMeasurement()
public double getMean()
public double getStandardDeviation()
public double getMax()
public double getMin()
public Statistics getStatistics()
public java.lang.String toString()
toString
in class java.lang.Object