|
Jive Forums API (5.5.8) 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)
MonitorAdd 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 Monitorquantity - the number of samples that occurred between the
last sample date and now
public void addSample(long quantity,
long startTime,
long endTime)
Carries out the actual sample addition.
addSample in interface Monitorquantity - 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()
MonitorObtain the total number of samples reported during the monitor's lifetime.
getTotal in interface Monitorpublic long getTotalTime()
MonitorObtain the total amount of time (in milliseconds) that the monitor has samples for.
getTotalTime in interface Monitorpublic float getRate()
MonitorObtain the rate of samples reported during the monitor's lifetime.
getRate in interface Monitorpublic java.util.Date getFirstSampleDate()
MonitorThe date-time of the first sample reported to the monitor.
getFirstSampleDate in interface Monitorpublic java.util.Date getLastSampleDate()
MonitorThe date-time of the last sample reported to the monitor.
getLastSampleDate in interface Monitorpublic int getFrameSize()
MonitorThe 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 Monitorpublic void setFrameSize(int newSize)
MonitorSets 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 MonitornewSize - the new size of the sample frame in seconds.public long getFrameTotal()
MonitorObtain the sample total during the frame.
getFrameTotal in interface Monitorpublic long getFrameTotalTime()
MonitorObtain the total sample time during the frame.
getFrameTotalTime in interface Monitorpublic float getFrameRate()
MonitorObtain 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 | |||||||||