|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.stat.Rate
public class Rate
Simple rate calculator for periodically sampled data points - determining an average value over a period, the number of events in that period, the maximum number of events (using the interval between events), and lifetime data.
Constructor Summary | |
---|---|
Rate(long period)
|
|
Rate(java.util.Properties props,
java.lang.String prefix,
boolean treatAsCurrent)
Create a new rate and load its state from the properties, taking data from the data points underneath the given prefix. |
Method Summary | |
---|---|
void |
addData(long value)
accrue the data in the current period as an instantaneous event |
void |
addData(long value,
long eventDuration)
Accrue the data in the current period as if the event took the specified amount of time |
void |
coalesce()
|
boolean |
equals(java.lang.Object obj)
|
double |
getAverageValue()
what was the average value across the events in the last period? |
long |
getCreationDate()
when was this rate created? |
long |
getCurrentEventCount()
in the current (partial) period, how many events have occurred? |
long |
getCurrentTotalEventTime()
in the current (partial) period, how much of the time has been spent doing the events? |
double |
getCurrentTotalValue()
in the current (partial) period, what is the total value acrued through all events? |
double |
getExtremeAverageValue()
what was the average value across the events in the most active period? |
long |
getExtremeEventCount()
when the max(totalValue) was achieved, how many events occurred in that period? |
double |
getExtremeEventSaturation()
During the extreme period, how much of the time was spent actually processing events in proportion to how many events could have occurred if there were no intervals? |
double |
getExtremeSaturationLimit()
using the extreme period's rate, what is the total value that could have been sent if events were constant? |
long |
getExtremeTotalEventTime()
when the max(totalValue) was achieved, how much of the time was spent doing the events? |
double |
getExtremeTotalValue()
what was the max total value acrued in any period? |
long |
getLastCoalesceDate()
when was the rate last coalesced? |
long |
getLastEventCount()
in the last full period, how many events occurred? |
double |
getLastEventSaturation()
During the last period, how much of the time was spent actually processing events in proportion to how many events could have occurred if there were no intervals? |
double |
getLastSaturationLimit()
using the last period's rate, what is the total value that could have been sent if events were constant? |
long |
getLastTotalEventTime()
in the last full period, how much of the time was spent doing the events? |
double |
getLastTotalValue()
in the last full period, what was the total value acrued through all events? |
double |
getLifetimeAverageValue()
what was the average value across the events since the stat was created? |
long |
getLifetimeEventCount()
since rate creation, how many events have occurred? |
double |
getLifetimeEventSaturation()
During the lifetime of this stat, how much of the time was spent actually processing events in proportion to how many events could have occurred if there were no intervals? |
long |
getLifetimePeriods()
how many periods have we already completed? |
long |
getLifetimeTotalEventTime()
since rate creation, how much of the time was spent doing the events? |
double |
getLifetimeTotalValue()
since rate creation, what was the total value acrued through all events? |
double |
getPercentageOfExtremeValue()
How large was the last period's value as compared to the largest period ever? |
double |
getPercentageOfLifetimeValue()
How large was the last period's value as compared to the lifetime average value? |
long |
getPeriod()
how large should this rate's cycle be? |
RateStat |
getRateStat()
|
RateSummaryListener |
getSummaryListener()
|
void |
load(java.util.Properties props,
java.lang.String prefix,
boolean treatAsCurrent)
Load this rate from the properties, taking data from the data points underneath the given prefix. |
static void |
main(java.lang.String[] args)
|
void |
setRateStat(RateStat rs)
|
void |
setSummaryListener(RateSummaryListener listener)
|
void |
store(java.lang.String prefix,
java.lang.StringBuffer buf)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Rate(long period) throws java.lang.IllegalArgumentException
period
- number of milliseconds in the period this rate deals with
java.lang.IllegalArgumentException
- if the period is not greater than 0public Rate(java.util.Properties props, java.lang.String prefix, boolean treatAsCurrent) throws java.lang.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.
java.lang.IllegalArgumentException
- if the data was formatted incorrectlyMethod Detail |
---|
public double getCurrentTotalValue()
public long getCurrentEventCount()
public long getCurrentTotalEventTime()
public double getLastTotalValue()
public long getLastEventCount()
public long getLastTotalEventTime()
public double getExtremeTotalValue()
public long getExtremeEventCount()
public long getExtremeTotalEventTime()
public double getLifetimeTotalValue()
public long getLifetimeEventCount()
public long getLifetimeTotalEventTime()
public long getLastCoalesceDate()
public long getCreationDate()
public long getPeriod()
public RateStat getRateStat()
public void setRateStat(RateStat rs)
public void addData(long value)
public void addData(long value, long eventDuration)
value
- value to accrue in the current periodeventDuration
- how long it took to accrue this data (set to 0 if it was instantaneous)public void coalesce()
public void setSummaryListener(RateSummaryListener listener)
public RateSummaryListener getSummaryListener()
public double getAverageValue()
public double getExtremeAverageValue()
public double getLifetimeAverageValue()
public double getLastEventSaturation()
public double getExtremeEventSaturation()
public double getLifetimeEventSaturation()
public long getLifetimePeriods()
public double getLastSaturationLimit()
public double getExtremeSaturationLimit()
public double getPercentageOfExtremeValue()
public double getPercentageOfLifetimeValue()
public void store(java.lang.String prefix, java.lang.StringBuffer buf) throws java.io.IOException
java.io.IOException
public void load(java.util.Properties props, java.lang.String prefix, boolean treatAsCurrent) throws java.lang.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.
java.lang.IllegalArgumentException
- if the data was formatted incorrectlypublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |