|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hyperic.util.stats.StatsCollector
public class StatsCollector
The StatsCollector is a class used to calculate metrics based on a series of events. Events consist of a value and a timestamp. This class is synchronized.
Constructor Summary | |
---|---|
StatsCollector(int size)
Create a new collector which is able to internally store 'size' elements. |
Method Summary | |
---|---|
void |
add(double value,
long timestamp)
Add a value to the collection. |
java.lang.String |
dump()
|
long |
getNewestTime()
Get the timestamp of the newest entry (or -1 if there are no entries) |
long |
getOldestTime()
Get the timestamp of the oldest entry (or -1 if there are no entries) |
int |
getSize()
Get the # of elements in the collector |
double |
getTotal()
Get the sum of all values. |
static void |
main(java.lang.String[] args)
|
double |
valPerTimestamp()
|
double |
valPerTimestamp(long newestTime)
Get the value per timestamp increment. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StatsCollector(int size)
Method Detail |
---|
public void add(double value, long timestamp)
public double getTotal()
public long getOldestTime()
public long getNewestTime()
public double valPerTimestamp(long newestTime)
public double valPerTimestamp()
public int getSize()
public java.lang.String dump()
public static void main(java.lang.String[] args)
|
Hyperic HQ Plugin API v. 4.4.0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |