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?
|
long |
getLastEvent()
Deprecated.
unused
|
double |
getMaxAverageEventsPerPeriod()
Calculate how many events would occur in a period given the maximum rolling average.
|
double |
getMinAverageInterval()
Deprecated.
unused
|
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 long getPeriod()
@Deprecated public long getLastEvent()
public double getAverageInterval()
@Deprecated public double getMinAverageInterval()
public double getAverageEventsPerPeriod()
public double getMaxAverageEventsPerPeriod()
public double getStrictAverageInterval()
public double getStrictAverageEventsPerPeriod()
public long getEventCount()
public void eventOccurred()
public void recalculate()
void store(StringBuilder dest)
dest
- to append data to