com.jamonapi
Class MonitorComposite

java.lang.Object
  extended by com.jamonapi.Monitor
      extended by com.jamonapi.MonitorComposite
All Implemented Interfaces:
DetailData

public class MonitorComposite
extends Monitor
implements DetailData


Field Summary
 
Fields inherited from class com.jamonapi.Monitor
MAX, MAXACTIVE, MIN, VALUE
 
Constructor Summary
MonitorComposite(Monitor[] monitors)
          Creates a new instance of MonitorComposite
 
Method Summary
 Monitor add(double value)
          This method adds a value to the monitor (and aggegates statistics on it)
 void disable()
          Disable the monitor.
 void enable()
          enable the monitor.
 double getActive()
           
 double getAvg()
           
 double getAvgActive()
          This returns a weighted average
 java.lang.Object[][] getBasicData()
          Get basic data (which excludes range data)
 java.lang.String[] getBasicHeader()
          Return the header that applies to all monitors.
 java.lang.Object[][] getData()
          Get all data including basic data as well as each element within the range
 java.lang.Object[][] getDisplayData()
          Get display data including 1 column for each range
 java.lang.String[] getDisplayHeader()
          Return the header with basic data and one column for each range.
 java.util.Date getFirstAccess()
           
 java.lang.String[] getHeader()
          Return the header with basic data and columns for each field within the range.
 double getHits()
           
 JAMonDetailValue getJAMonDetailRow()
           
 java.util.Date getLastAccess()
           
 double getLastValue()
           
 double getMax()
           
 double getMaxActive()
           
 double getMin()
           
 Monitor[] getMonitors()
           
static MonitorComposite getMonitors(java.lang.String[][] labels)
          Pass in an array with col1=lables, and col2=units and then call methods
 MonKey getMonKey()
          Return the label associated with this monitor.
 int getNumRows()
           
 Range getRange()
          Return the Range object associated with this monitor.
 java.lang.String getReport()
          A basic report in html format.
 java.lang.String getReport(int sortCol, java.lang.String sortOrder)
          A basic report in html format that is sorted.
 double getStdDev()
          This is not a true standard deviation but a average weighted std deviation.
 double getTotal()
           
 boolean hasData()
          Does this have data?
 boolean hasListeners()
           
 boolean isActivityTracking()
           
 boolean isEnabled()
          It just takes one of the monitors to not be enabled for the composite to be false
 boolean isPrimary()
          It just takes one of the monitors to not be primary for the composite to be false
 void reset()
          reset all values in the monitor to their defaults
 void setActive(double value)
           
 void setActivityTracking(boolean trackActivity)
          FROM frequencydistimp
 void setFirstAccess(java.util.Date date)
           
 void setHits(double value)
           
 void setLastAccess(java.util.Date date)
           
 void setLastValue(double value)
           
 void setMax(double value)
           
 void setMaxActive(double value)
           
 void setMin(double value)
           
 void setPrimary(boolean isPrimary)
          Indicate that this a primary Monitor.
 void setTotal(double value)
           
 void setTotalActive(double value)
          Neeed to reset this to 0.0 to remove avg active numbers
 Monitor start()
          Start a monitor.
 Monitor stop()
          Stop a monitor.
 
Methods inherited from class com.jamonapi.Monitor
getAvgGlobalActive, getAvgPrimaryActive, getLabel, getListenerType, getUnits, setAccessStats, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MonitorComposite

public MonitorComposite(Monitor[] monitors)
Creates a new instance of MonitorComposite

Method Detail

getMonitors

public Monitor[] getMonitors()

getMonitors

public static MonitorComposite getMonitors(java.lang.String[][] labels)
Pass in an array with col1=lables, and col2=units and then call methods


getNumRows

public int getNumRows()

getBasicHeader

public java.lang.String[] getBasicHeader()
Return the header that applies to all monitors. It does not include range column headers. It will contain label, hits, total, avg, min, max and active among other columns


getHeader

public java.lang.String[] getHeader()
Return the header with basic data and columns for each field within the range. note getHeader only works if the range of all monitors in the composite are the same.

Specified by:
getHeader in interface DetailData

getDisplayHeader

public java.lang.String[] getDisplayHeader()
Return the header with basic data and one column for each range. Note this only will work with ranges of the same type


getData

public java.lang.Object[][] getData()
Get all data including basic data as well as each element within the range

Specified by:
getData in interface DetailData

getBasicData

public java.lang.Object[][] getBasicData()
Get basic data (which excludes range data)


getDisplayData

public java.lang.Object[][] getDisplayData()
Get display data including 1 column for each range


getReport

public java.lang.String getReport()
A basic report in html format. It has summary info for all monitors but no range info


getReport

public java.lang.String getReport(int sortCol,
                                  java.lang.String sortOrder)
A basic report in html format that is sorted. It has summary info for all monitors but no range info


hasData

public boolean hasData()
Does this have data?


reset

public void reset()
reset all values in the monitor to their defaults

Overrides:
reset in class Monitor

disable

public void disable()
Disable the monitor. If a monitor is disabled all other calls to the monitor are noops.

Overrides:
disable in class Monitor

enable

public void enable()
enable the monitor. If the monitor is enabled all other calls to the monitor have an action

Overrides:
enable in class Monitor

getActive

public double getActive()
Overrides:
getActive in class Monitor

getAvg

public double getAvg()
Overrides:
getAvg in class Monitor

getAvgActive

public double getAvgActive()
This returns a weighted average

Overrides:
getAvgActive in class Monitor

getFirstAccess

public java.util.Date getFirstAccess()
Overrides:
getFirstAccess in class Monitor

getHits

public double getHits()
Overrides:
getHits in class Monitor

getMonKey

public MonKey getMonKey()
Return the label associated with this monitor.

Overrides:
getMonKey in class Monitor

getLastAccess

public java.util.Date getLastAccess()
Overrides:
getLastAccess in class Monitor

getLastValue

public double getLastValue()
Overrides:
getLastValue in class Monitor

getMax

public double getMax()
Overrides:
getMax in class Monitor

getMaxActive

public double getMaxActive()
Overrides:
getMaxActive in class Monitor

getMin

public double getMin()
Overrides:
getMin in class Monitor

getRange

public Range getRange()
Return the Range object associated with this monitor. The range object is a compromise between saving all data or none

Overrides:
getRange in class Monitor

getStdDev

public double getStdDev()
This is not a true standard deviation but a average weighted std deviation. However individual monitors do have a true standard deviation

Overrides:
getStdDev in class Monitor

getTotal

public double getTotal()
Overrides:
getTotal in class Monitor

isEnabled

public boolean isEnabled()
It just takes one of the monitors to not be enabled for the composite to be false

Overrides:
isEnabled in class Monitor

isPrimary

public boolean isPrimary()
It just takes one of the monitors to not be primary for the composite to be false

Overrides:
isPrimary in class Monitor

setActive

public void setActive(double value)
Overrides:
setActive in class Monitor

setFirstAccess

public void setFirstAccess(java.util.Date date)
Overrides:
setFirstAccess in class Monitor

setHits

public void setHits(double value)
Overrides:
setHits in class Monitor

setLastAccess

public void setLastAccess(java.util.Date date)
Overrides:
setLastAccess in class Monitor

setLastValue

public void setLastValue(double value)
Overrides:
setLastValue in class Monitor

setMax

public void setMax(double value)
Overrides:
setMax in class Monitor

setMaxActive

public void setMaxActive(double value)
Overrides:
setMaxActive in class Monitor

setMin

public void setMin(double value)
Overrides:
setMin in class Monitor

setPrimary

public void setPrimary(boolean isPrimary)
Indicate that this a primary Monitor. See www.jamonapi.com for an explanation of primary monitors

Overrides:
setPrimary in class Monitor

setTotal

public void setTotal(double value)
Overrides:
setTotal in class Monitor

setTotalActive

public void setTotalActive(double value)
Description copied from class: Monitor
Neeed to reset this to 0.0 to remove avg active numbers

Overrides:
setTotalActive in class Monitor

start

public Monitor start()
Start a monitor. This increments the active counter by one. Calling start is not required. If it is called stop should be called too.

Overrides:
start in class Monitor

stop

public Monitor stop()
Stop a monitor. The decrements the active counter by one. Calling stop is required if start is called.

Overrides:
stop in class Monitor

add

public Monitor add(double value)
This method adds a value to the monitor (and aggegates statistics on it)

Overrides:
add in class Monitor

hasListeners

public boolean hasListeners()
Overrides:
hasListeners in class Monitor

getJAMonDetailRow

public JAMonDetailValue getJAMonDetailRow()
Overrides:
getJAMonDetailRow in class Monitor

setActivityTracking

public void setActivityTracking(boolean trackActivity)
Description copied from class: Monitor
FROM frequencydistimp

Overrides:
setActivityTracking in class Monitor

isActivityTracking

public boolean isActivityTracking()
Overrides:
isActivityTracking in class Monitor