public class Frequency extends Object
| Constructor and Description |
|---|
Frequency(long period) |
| Modifier and Type | Method and Description |
|---|---|
void |
eventOccurred()
Take note that a new event occurred, recalculating all the averages and frequencies
|
double |
getAverageEventsPerPeriod()
Calculate how many events would occur in a period given the current (rolling) average.
|
double |
getAverageInterval()
on average over the last $period, after how many milliseconds are events coming in,
as calculated during the last event occurrence?
|
long |
getEventCount()
how many events have occurred within the lifetime of this stat?
|
double |
getMaxAverageEventsPerPeriod()
Calculate how many events would occur in a period given the maximum rolling average.
|
long |
getPeriod()
how long is this frequency averaged over? (ms)
|
double |
getStrictAverageEventsPerPeriod()
using the strict average interval, how many events occur within an average period?
|
double |
getStrictAverageInterval()
Over the lifetime of this stat, without any decay or weighting, what was the average interval between events? (ms)
|
void |
recalculate()
Recalculate the averages
|
(package private) void |
store(StringBuilder dest)
Appends the data of this frequency to the specified StringBuilder
|
public void eventOccurred()
public double getAverageEventsPerPeriod()
public double getAverageInterval()
public long getEventCount()
public double getMaxAverageEventsPerPeriod()
public long getPeriod()
public double getStrictAverageEventsPerPeriod()
public double getStrictAverageInterval()
public void recalculate()
void store(StringBuilder dest)
dest - to append data to