|
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 |
public interface Monitor
Monitors a network usage.
Monitors measure sample totals, and sample rate (samples per second). Monitor information is used at runtime to adjust server behavior as well as to generate reports on server history.
Based in part on the DataMonitor from Java Distributed Computing, Jim Farley, O'Reilly.
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)
Add the number of samples that occured between the given start and end times. |
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 frameSize)
Sets the size of the moving frame (in sample events). |
Method Detail |
---|
void addSample(long quantity, long startTime, long endTime)
Add the number of samples that occured between the given start and end times.
The monitor does not check for overlapping sample times. It is the caller's responsibility to ensure samples don't overlap. Failure to prevent overlapping sample times may result in elapsed time being falsely counted and reported.
quantity
- the number of samples that occurred during the sample period.startTime
- the beginning of the sample period (system time millis).endTime
- the end of the sample period (system time millis).void addSample(long quantity)
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());
quantity
- the number of samples that occurred between the
last sample date and nowlong 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.
float getRate()
Obtain the rate of samples reported during the monitor's lifetime.
java.util.Date getFirstSampleDate()
The date-time of the first sample reported to the monitor.
java.util.Date getLastSampleDate()
The date-time of the last sample reported to the monitor.
int getFrameSize()
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.
void setFrameSize(int frameSize)
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.
frameSize
- the new size of the sample frame in seconds.long getFrameTotal()
Obtain the sample total during the frame.
long getFrameTotalTime()
Obtain the total sample time during the frame.
float getFrameRate()
Obtain the number of bytes read during the frame.
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |