net.i2p.stat
public class RateStat extends Object
Constructor and Description |
---|
RateStat(String name,
String description,
String group,
long[] periods) |
Modifier and Type | Method and Description |
---|---|
void |
addData(long value,
long eventDuration)
update all of the rates for the various periods with the given value.
|
void |
coalesceStats()
coalesce all the stats
|
boolean |
equals(Object obj) |
String |
getDescription() |
String |
getGroupName() |
double |
getLifetimeAverageValue() |
long |
getLifetimeEventCount() |
String |
getName() |
long[] |
getPeriods() |
Rate |
getRate(long period) |
int |
hashCode() |
void |
load(Properties props,
String prefix,
boolean treatAsCurrent)
Load this rate stat from the properties, populating all of the rates contained
underneath it.
|
void |
setStatLog(StatLog sl) |
void |
store(OutputStream out,
String prefix) |
String |
toString() |
public void setStatLog(StatLog sl)
public void addData(long value, long eventDuration)
public void coalesceStats()
public String getName()
public String getGroupName()
public String getDescription()
public long[] getPeriods()
public double getLifetimeAverageValue()
public long getLifetimeEventCount()
public Rate getRate(long period)
public void store(OutputStream out, String prefix) throws IOException
IOException
public void load(Properties props, String prefix, boolean treatAsCurrent) throws IllegalArgumentException
prefix
- prefix to the property entries (should NOT end with a period)treatAsCurrent
- if true, we'll treat the loaded data as if no time has
elapsed since it was written out, but if it is false, we'll
treat the data with as much freshness (or staleness) as appropriate.IllegalArgumentException
- if the data was formatted incorrectly