|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.stat.StatManager
public class StatManager
Coordinate the management of various frequencies and rates within I2P components, both allowing central update and retrieval, as well as distributed creation and use. This does not provide any persistence, but the data structures exposed can be read and updated to manage the complete state.
Field Summary | |
---|---|
static String |
DEFAULT_STAT_FILE
|
static String |
PROP_STAT_FILE
|
static String |
PROP_STAT_FILTER
Comma-separated stats or * for all. |
static String |
PROP_STAT_FULL
default false |
Constructor Summary | |
---|---|
StatManager(I2PAppContext context)
The stat manager should only be constructed and accessed through the application context. |
Method Summary | |
---|---|
void |
addRateData(String name,
long data,
long eventDuration)
update the given rate statistic, taking note that the given data point was received (and recalculating all rates) |
void |
coalesceStats()
|
void |
createFrequencyStat(String name,
String description,
String group,
long[] periods)
Create a new statistic to monitor the frequency of some event. |
void |
createRateStat(String name,
String description,
String group,
long[] periods)
Create a new statistic to monitor the average value and confidence of some action. |
void |
createRequiredFrequencyStat(String name,
String description,
String group,
long[] periods)
Create a new statistic to monitor the frequency of some event. |
void |
createRequiredRateStat(String name,
String description,
String group,
long[] periods)
Create a new statistic to monitor the average value and confidence of some action. |
FrequencyStat |
getFrequency(String name)
|
Set<String> |
getFrequencyNames()
|
RateStat |
getRate(String name)
|
Set<String> |
getRateNames()
|
String |
getStatFile()
|
String |
getStatFilter()
|
StatLog |
getStatLog()
may be null |
Map |
getStatsByGroup()
Group name (String) to a Set of stat names, ordered alphabetically |
boolean |
ignoreStat(String statName)
Save memory by not creating stats unless they are required for router operation. |
boolean |
isFrequency(String statName)
is the given stat a monitored frequency? |
boolean |
isRate(String statName)
is the given stat a monitored rate? |
void |
removeRateStat(String name)
|
void |
setStatLog(StatLog log)
|
void |
updateFrequency(String name)
update the given frequency statistic, taking note that an event occurred (and recalculating all frequencies) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PROP_STAT_FILTER
public static final String PROP_STAT_FILE
public static final String DEFAULT_STAT_FILE
public static final String PROP_STAT_FULL
Constructor Detail |
---|
public StatManager(I2PAppContext context)
Method Detail |
---|
public StatLog getStatLog()
public void setStatLog(StatLog log)
public void createFrequencyStat(String name, String description, String group, long[] periods)
name
- unique name of the statisticdescription
- simple description of the statisticgroup
- used to group statistics togetherperiods
- array of period lengths (in milliseconds)public void createRequiredFrequencyStat(String name, String description, String group, long[] periods)
name
- unique name of the statisticdescription
- simple description of the statisticgroup
- used to group statistics togetherperiods
- array of period lengths (in milliseconds)public void createRateStat(String name, String description, String group, long[] periods)
name
- unique name of the statisticdescription
- simple description of the statisticgroup
- used to group statistics togetherperiods
- array of period lengths (in milliseconds)public void createRequiredRateStat(String name, String description, String group, long[] periods)
name
- unique name of the statisticdescription
- simple description of the statisticgroup
- used to group statistics togetherperiods
- array of period lengths (in milliseconds)public void removeRateStat(String name)
public void updateFrequency(String name)
public void addRateData(String name, long data, long eventDuration)
public void coalesceStats()
public FrequencyStat getFrequency(String name)
public RateStat getRate(String name)
public Set<String> getFrequencyNames()
public Set<String> getRateNames()
public boolean isRate(String statName)
public boolean isFrequency(String statName)
public Map getStatsByGroup()
public String getStatFilter()
public String getStatFile()
public boolean ignoreStat(String statName)
statName
- ignored
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |