|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.stat.Frequency
public class Frequency
Manage the calculation of a moving average event frequency over a certain period. This provides lifetime, and rolling average, frequency counts. Unlike Rate, it does not support "bucketed" averages. There is no tracking of the event frequency in the current or last bucket. There are no buckets at all. Depending on what you want, a rolling average might be better than buckets. Or not.
Constructor Summary | |
---|---|
Frequency(long period)
|
Method Summary | |
---|---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Frequency(long period)
period
- msMethod Detail |
---|
public long getPeriod()
public long getLastEvent()
public double getAverageInterval()
public double getMinAverageInterval()
public double getAverageEventsPerPeriod()
public double getMaxAverageEventsPerPeriod()
public double getStrictAverageInterval()
public double getStrictAverageEventsPerPeriod()
public long getEventCount()
public void eventOccurred()
public void recalculate()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |