|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.limegroup.gnutella.Statistics
Maintains various session statistics, like uptime. Implements the Singleton pattern. Statistics are initialized the when the class is loaded; call Statistics.instance() to guarantee initialization.
Constructor Summary | |
protected |
Statistics()
"PROTECTED" FOR TESTING PURPOSES ONLY! |
Method Summary | |
int |
calculateDailyUptime()
Calculates the average number of seconds this host runs per day, i.e., calculateFractionRunning*24*60*60. |
float |
calculateFractionalUptime()
Calculates the fraction of time this is running, a unitless quantity between zero and 1. |
long |
getUptime()
Returns the amount of time this has been running. |
static Statistics |
instance()
Returns the single Statistics instance. |
protected long |
now()
The current system time, in milliseconds. |
void |
shutdown()
Notifies this that LimeWire is shutting down, updating permanent statistics in limewire.props if necessary. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected Statistics()
Method Detail |
public static Statistics instance()
public long getUptime()
public int calculateDailyUptime()
calculateFractionalUptime
public float calculateFractionalUptime()
calculateDailyUptime
public void shutdown()
protected long now()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |