com.jamonapi
Class ActiveStatsMonitor

java.lang.Object
  extended bycom.jamonapi.AccumulateMonitor
      extended bycom.jamonapi.ActiveStatsMonitor
All Implemented Interfaces:
AccumulateMonitorInterface, MinimalMonitor

public class ActiveStatsMonitor
extends AccumulateMonitor

Tracks statistics for Monitors that are currently running. The statistics tracked are how often this Monitor is called (hits), how many outstanding invocations of start() have been called without a stop() for this instance (active), what is the average number of active for this instance, and what was the maximum number of active for this instance.


Field Summary
 
Fields inherited from class com.jamonapi.AccumulateMonitor
accrued, ACTIVE, AVG, AVGACTIVE, HITS, MAX, MAXACTIVE, MILLISECONDS, MIN, NONE, STANDARD_DEVIATION, TOTAL
 
Constructor Summary
ActiveStatsMonitor()
           
ActiveStatsMonitor(AccumulateMonitorInterface childMonitor)
          Constructor that uses the Gang Of 4's decorator pattern.
 
Method Summary
 long getAccrued()
          Return the number of Active Monitors of this instance
protected  void getDataThis(java.util.ArrayList rowData)
          Add this instances data to the ArrayList.
protected  void getHeaderThis(java.util.ArrayList header)
          Add this instances header to the ArrayList.
protected  void increaseThis(long increase)
          Add the value passed to this method to the Monitor's accrued value
static void main(java.lang.String[] args)
          Method that contains test data for this class
protected  void resetThis()
          Reset the variables for this instance to their default values
protected  void startThis()
          Adjust the statistics being tracked whenever start() is called.
protected  void stopThis()
          Adjust the statistics being tracked whenever stop() is called.
protected  java.lang.String toStringThis()
          Convert this Monitor to its String value for display purposes
 
Methods inherited from class com.jamonapi.AccumulateMonitor
convertToString, getAccruedString, getData, getDisplayString, getHeader, getType, getUnits, increase, increase, isPrimary, reset, setPrimary, start, stop, toString, toStringChild
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ActiveStatsMonitor

public ActiveStatsMonitor()

ActiveStatsMonitor

public ActiveStatsMonitor(AccumulateMonitorInterface childMonitor)
Constructor that uses the Gang Of 4's decorator pattern.

Method Detail

startThis

protected void startThis()
Adjust the statistics being tracked whenever start() is called. For example whenever start() is called on this instance the active variable is increased by 1.

Overrides:
startThis in class AccumulateMonitor

stopThis

protected void stopThis()
Adjust the statistics being tracked whenever stop() is called. For example whenever stop() is called on this instance the active variable is decreased by 1.

Overrides:
stopThis in class AccumulateMonitor

increaseThis

protected void increaseThis(long increase)
Description copied from class: AccumulateMonitor
Add the value passed to this method to the Monitor's accrued value

Overrides:
increaseThis in class AccumulateMonitor

resetThis

protected void resetThis()
Reset the variables for this instance to their default values

Overrides:
resetThis in class AccumulateMonitor

toStringThis

protected java.lang.String toStringThis()
Convert this Monitor to its String value for display purposes

Overrides:
toStringThis in class AccumulateMonitor

getDataThis

protected void getDataThis(java.util.ArrayList rowData)
Add this instances data to the ArrayList. This method is used to convert Monitor data to a tabular format

Overrides:
getDataThis in class AccumulateMonitor

getHeaderThis

protected void getHeaderThis(java.util.ArrayList header)
Add this instances header to the ArrayList. This method is used to convert Monitor header data to a tabular format. The header will usually be used to display the Monitor in HTML format

Overrides:
getHeaderThis in class AccumulateMonitor

getAccrued

public long getAccrued()
Return the number of Active Monitors of this instance

Specified by:
getAccrued in interface MinimalMonitor
Overrides:
getAccrued in class AccumulateMonitor

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Method that contains test data for this class

Throws:
java.lang.Exception