Package net.i2p.stat
Class FrequencyStat
java.lang.Object
net.i2p.stat.FrequencyStat
coordinate an event frequency over various periods
-
Constructor Summary
ConstructorDescriptionFrequencyStat
(String name, String description, String group, long[] periods) -
Method Summary
Modifier and TypeMethodDescriptionvoid
coalesce all the statsboolean
void
update all of the frequencies for the various periodslong
long
getFrequency
(long period) getName()
long[]
int
hashCode()
void
store
(OutputStream out, String prefix) Serializes this FrequencyStat to the provided OutputStream
-
Constructor Details
-
FrequencyStat
-
-
Method Details
-
eventOccurred
public void eventOccurred()update all of the frequencies for the various periods -
coalesceStats
public void coalesceStats()coalesce all the stats -
getName
-
getGroupName
-
getDescription
-
getPeriods
public long[] getPeriods() -
getFrequency
-
getEventCount
public long getEventCount()- Returns:
- lifetime event count
- Since:
- 0.8.2
-
getFrequency
public long getFrequency()- Returns:
- lifetime average frequency in millisedonds, i.e. the average time between events, or Long.MAX_VALUE if no events ever
- Since:
- 0.8.2
-
hashCode
public int hashCode() -
equals
-
store
Serializes this FrequencyStat to the provided OutputStream- Parameters:
out
- to write toprefix
- to prepend to the stat- Throws:
IOException
- if something goes wrong- Since:
- 0.9.23
-