|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jivesoftware.forum.net.spi.BasicTransientMonitor
public class BasicTransientMonitor
Implements a transient (in-memory) generic monitor.
Constructor Summary | |
---|---|
BasicTransientMonitor()
|
Method Summary | |
---|---|
void |
addSample(long quantity)
Add the number of samples that occured between the last sample date, and the current time. |
void |
addSample(long quantity,
long startTime,
long endTime)
Carries out the actual sample addition. |
java.util.Date |
getFirstSampleDate()
The date-time of the first sample reported to the monitor. |
float |
getFrameRate()
Obtain the number of bytes read during the frame. |
int |
getFrameSize()
The size of the moving frame (in sample events) that provides a recent view of the data. |
long |
getFrameTotal()
Obtain the sample total during the frame. |
long |
getFrameTotalTime()
Obtain the total sample time during the frame. |
java.util.Date |
getLastSampleDate()
The date-time of the last sample reported to the monitor. |
float |
getRate()
Obtain the rate of samples reported during the monitor's lifetime. |
long |
getTotal()
Obtain the total number of samples reported during the monitor's lifetime. |
long |
getTotalTime()
Obtain the total amount of time (in milliseconds) that the monitor has samples for. |
void |
setFrameSize(int newSize)
Sets the size of the moving frame (in sample events). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicTransientMonitor()
Method Detail |
---|
public void addSample(long quantity)
Monitor
Add the number of samples that occured between the last sample date, and the current time.
A convenience method when samples occur in sequential periods. Equivalent to:
monitor.addSample(quantity, monitor.getLastSampleDate(), new Date());
addSample
in interface Monitor
quantity
- the number of samples that occurred between the
last sample date and nowpublic void addSample(long quantity, long startTime, long endTime)
Carries out the actual sample addition.
addSample
in interface Monitor
quantity
- the quantity of the sample.startTime
- the start time in milliseconds since the epoch.endTime
- the stop time in milliseconds since the epoch.public long getTotal()
Monitor
Obtain the total number of samples reported during the monitor's lifetime.
getTotal
in interface Monitor
public long getTotalTime()
Monitor
Obtain the total amount of time (in milliseconds) that the monitor has samples for.
getTotalTime
in interface Monitor
public float getRate()
Monitor
Obtain the rate of samples reported during the monitor's lifetime.
getRate
in interface Monitor
public java.util.Date getFirstSampleDate()
Monitor
The date-time of the first sample reported to the monitor.
getFirstSampleDate
in interface Monitor
public java.util.Date getLastSampleDate()
Monitor
The date-time of the last sample reported to the monitor.
getLastSampleDate
in interface Monitor
public int getFrameSize()
Monitor
The size of the moving frame (in sample events) that provides a recent view of the data.
Samples can be monitored and managed based on the usage within the most recent number of samples reported during the frame. Larger frame sizes 'smooths' the results creating frame statistics that are less affected by outlying samples but requiring larger amounts of memory to store and more resources to calculate frame statistics.
getFrameSize
in interface Monitor
public void setFrameSize(int newSize)
Monitor
Sets the size of the moving frame (in sample events).
Changing the frame size to a larger value will not automatically include past samples that were previously outside the frame. Instead, the monitor will not return accurate frame related data until the new frame is filled with new data.
Warning: Larger frame sizes consume larger amounts of memory per monitor and increases the amount of work required to generate frame statistics. Set the framesize to the smallest useful size or zero to not record any frame related data.
setFrameSize
in interface Monitor
newSize
- the new size of the sample frame in seconds.public long getFrameTotal()
Monitor
Obtain the sample total during the frame.
getFrameTotal
in interface Monitor
public long getFrameTotalTime()
Monitor
Obtain the total sample time during the frame.
getFrameTotalTime
in interface Monitor
public float getFrameRate()
Monitor
Obtain the number of bytes read during the frame.
getFrameRate
in interface Monitor
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |