Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.net.spi
Class BasicTransientMonitor

java.lang.Object
  extended by com.jivesoftware.forum.net.spi.BasicTransientMonitor
All Implemented Interfaces:
Monitor
Direct Known Subclasses:
CommandMonitorImpl, TransientBandwidthMonitor, TransientConnectionMonitor

public class BasicTransientMonitor
extends java.lang.Object
implements Monitor

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

BasicTransientMonitor

public BasicTransientMonitor()
Method Detail

addSample

public void addSample(long quantity)
Description copied from interface: 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());
 

Specified by:
addSample in interface Monitor
Parameters:
quantity - the number of samples that occurred between the last sample date and now

addSample

public void addSample(long quantity,
                      long startTime,
                      long endTime)

Carries out the actual sample addition.

Specified by:
addSample in interface Monitor
Parameters:
quantity - the quantity of the sample.
startTime - the start time in milliseconds since the epoch.
endTime - the stop time in milliseconds since the epoch.

getTotal

public long getTotal()
Description copied from interface: Monitor

Obtain the total number of samples reported during the monitor's lifetime.

Specified by:
getTotal in interface Monitor
Returns:
the total number of samples reported to the monitor.

getTotalTime

public long getTotalTime()
Description copied from interface: Monitor

Obtain the total amount of time (in milliseconds) that the monitor has samples for.

Specified by:
getTotalTime in interface Monitor
Returns:
the total time (in milliseconds) samples have been recorded for.

getRate

public float getRate()
Description copied from interface: Monitor

Obtain the rate of samples reported during the monitor's lifetime.

Specified by:
getRate in interface Monitor
Returns:
the average rate of samples reported to the monitor.

getFirstSampleDate

public java.util.Date getFirstSampleDate()
Description copied from interface: Monitor

The date-time of the first sample reported to the monitor.

Specified by:
getFirstSampleDate in interface Monitor
Returns:
the date-time of the first sample reported to the monitor.

getLastSampleDate

public java.util.Date getLastSampleDate()
Description copied from interface: Monitor

The date-time of the last sample reported to the monitor.

Specified by:
getLastSampleDate in interface Monitor
Returns:
the date-time of the last sample reported to the monitor.

getFrameSize

public int getFrameSize()
Description copied from interface: 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.

Specified by:
getFrameSize in interface Monitor
Returns:
the sample frame size in seconds.

setFrameSize

public void setFrameSize(int newSize)
Description copied from interface: 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.

Specified by:
setFrameSize in interface Monitor
Parameters:
newSize - the new size of the sample frame in seconds.

getFrameTotal

public long getFrameTotal()
Description copied from interface: Monitor

Obtain the sample total during the frame.

Specified by:
getFrameTotal in interface Monitor
Returns:
the sample total during the frame.

getFrameTotalTime

public long getFrameTotalTime()
Description copied from interface: Monitor

Obtain the total sample time during the frame.

Specified by:
getFrameTotalTime in interface Monitor
Returns:
the total sample time during the frame.

getFrameRate

public float getFrameRate()
Description copied from interface: Monitor

Obtain the number of bytes read during the frame.

Specified by:
getFrameRate in interface Monitor
Returns:
the number of bytes read during the frame.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.