|
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.TimeWindowCollector
public class TimeWindowCollector
Maintains a list of DataPoint
s which all lie within a specific
time range. This class is useful for storing 'the last 30 minutes of data'
and rolling the oldest data points off.
This class relies on datapoints being placed into the collector in
time-sorted order.
Constructor Summary | |
---|---|
TimeWindowCollector(long windowSize)
|
Method Summary | |
---|---|
void |
addPoint(DataPoint pt)
|
void |
addPoint(long time,
double value)
Add a new datapoint to the collection -- does not roll off old datapoints. |
double |
getSum()
Get a sum of all the encapsulated data points |
boolean |
hasRolled()
Returns true if data has been rolled off the back of the time-window. |
void |
removeOldPoints()
Remove old datapoints. |
void |
removeOldPoints(long currentTime)
Remove old datapoints. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TimeWindowCollector(long windowSize)
windowSize
- The size of the window (in millis) that all the
encapsulated datapoints should be within.Method Detail |
---|
public void addPoint(long time, double value)
public void addPoint(DataPoint pt)
addPoint(long, double)
public boolean hasRolled()
public double getSum()
public void removeOldPoints()
public void removeOldPoints(long currentTime)
|
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 |