|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.stat.RateStat
public class RateStat
coordinate a moving rate over various periods
Field Summary | |
---|---|
protected ConcurrentHashMap<Long,Rate> |
_rates
actual rate objects for this statistic |
Constructor Summary | |
---|---|
RateStat(String name,
String description,
String group,
long[] periods)
|
Method Summary | |
---|---|
void |
addData(long value)
Update all of the rates for the various periods with the given value. |
void |
addData(long value,
long eventDuration)
update all of the rates for the various periods with the given value. |
void |
addRate(long period)
Adds a new rate with the requested period, provided that a rate with that period does not already exist. |
void |
coalesceStats()
coalesce all the stats |
boolean |
containsRate(long period)
Tests if a rate with the provided period exists within this RateStat. |
boolean |
equals(Object obj)
|
String |
getDescription()
|
String |
getGroupName()
|
double |
getLifetimeAverageValue()
|
long |
getLifetimeEventCount()
|
String |
getName()
|
long[] |
getPeriods()
|
Rate |
getRate(long period)
Returns rate with requested period if it exists, otherwise null |
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 |
removeRate(long period)
If a rate with the provided period exists, remove it. |
void |
setStatLog(StatLog sl)
|
void |
store(OutputStream out,
String prefix)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final ConcurrentHashMap<Long,Rate> _rates
Constructor Detail |
---|
public RateStat(String name, String description, String group, long[] periods)
Method Detail |
---|
public void setStatLog(StatLog sl)
public void addData(long value, long eventDuration)
public void addData(long value)
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)
period
- ms
public void addRate(long period)
period
- mspublic void removeRate(long period)
period
- mspublic boolean containsRate(long period)
period
- ms
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public boolean equals(Object obj)
equals
in class Object
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |