com.jamonapi
Class TimingMonitor

java.lang.Object
  |
  +--com.jamonapi.Monitor
        |
        +--com.jamonapi.BaseMonitor
              |
              +--com.jamonapi.TimingMonitor
All Implemented Interfaces:
LeafNode, MinimalMonitor

public class TimingMonitor
extends BaseMonitor
implements LeafNode

This is the Monitor class that starts the decorator chain of Monitors. It tracks the time for this monitor and passes the time down the chain to the other Monitors, so they can track the other statistics.


Method Summary
 long getAccrued()
          Returns the time that the Monitor has been running
 void getData(java.util.ArrayList rowData)
          Add this elements value to the ArrayList.
 void getHeader(java.util.ArrayList header)
          Add this elements header value to an ArrayList.
 void increase(long increaseValue)
          increase the time by the specified ammount of milliseconds.
 boolean isPrimary()
          Is this a primary Monitor.
static void main(java.lang.String[] args)
          Method with the classes test code
 void reset()
          Resets the accrued time and restarts the Monitor
 void setPrimary(boolean primary)
          Indicate that this a primary Monitor.
 Monitor start()
          Start timing for the Monitor
 Monitor stop()
          Stop the Monitor and keep track of how long it was running.
 java.lang.String toString()
           
 
Methods inherited from class com.jamonapi.BaseMonitor
getAccruedString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getAccrued

public long getAccrued()
Returns the time that the Monitor has been running

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

reset

public void reset()
Resets the accrued time and restarts the Monitor

Specified by:
reset in interface MinimalMonitor
Overrides:
reset in class BaseMonitor

increase

public void increase(long increaseValue)
increase the time by the specified ammount of milliseconds. Typically this will not be called.

Specified by:
increase in interface MinimalMonitor
Overrides:
increase in class BaseMonitor

start

public Monitor start()
Start timing for the Monitor

Overrides:
start in class BaseMonitor

getData

public void getData(java.util.ArrayList rowData)
Description copied from interface: MinimalMonitor
Add this elements value to the ArrayList. This is used to display the Monitor in a tabular format.

Specified by:
getData in interface MinimalMonitor
Overrides:
getData in class BaseMonitor

getHeader

public void getHeader(java.util.ArrayList header)
Description copied from interface: MinimalMonitor
Add this elements header value to an ArrayList. This is used to display the Monitor in a tabular format.

Specified by:
getHeader in interface MinimalMonitor
Overrides:
getHeader in class BaseMonitor

stop

public Monitor stop()
Stop the Monitor and keep track of how long it was running. Call the next Monitor in the Monitor decorator chain

Overrides:
stop in class BaseMonitor

isPrimary

public boolean isPrimary()
Description copied from class: Monitor
Is this a primary Monitor. See www.jamonapi.com for an explanation of primary monitors

Specified by:
isPrimary in class Monitor

setPrimary

public void setPrimary(boolean primary)
Description copied from class: Monitor
Indicate that this a primary Monitor. See www.jamonapi.com for an explanation of primary monitors

Specified by:
setPrimary in class Monitor

toString

public java.lang.String toString()
Overrides:
toString in class BaseMonitor

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Method with the classes test code

java.lang.Exception