public class Monitor extends oracle.adfmf.performance.StopWatch implements JSONSerializable
| Constructor and Description | 
|---|
| Monitor(MonitorId id,
       String description)Creates a new monitor. | 
| Monitor(String id,
       java.util.logging.Level level,
       String description)Creates a new monitor. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addObservation()Records the observation and stops the monitor. | 
| void | addObservation(double duration)Records the obervation but does not stop the monitor. | 
| void | addObservation(long stopTime,
              double duration)Records observation observed at a specified time. | 
| String | getDescription() | 
| MonitorId | getId() | 
| java.util.logging.Level | getLevel() | 
| double | getMean() | 
| long | getObservations() | 
| void | setId(MonitorId id) | 
| long | start()Starts the Monitor at the current time and optionally records a start message. | 
| long | start(long startTime)Starts this Monitor at a specified time. | 
| double | stop()Stops the Monitor and optionally records a stop message. | 
| Object | toJSON()Method to add custom code to serialize the Object to JSON | 
| String | toString() | 
public Monitor(String id,
               java.util.logging.Level level,
               String description)
id - a unique identifier for a monitorlevel - logging leveldescription - a user friendly description of what measurement is capturedpublic Monitor(MonitorId id, String description)
id - a unique identifier for a monitordescription - a user friendly description of what measurement is capturedpublic MonitorId getId()
public void setId(MonitorId id)
public java.util.logging.Level getLevel()
public String getDescription()
public void addObservation()
public void addObservation(double duration)
duration - time since the last observationpublic void addObservation(long stopTime,
                           double duration)
stopTime - time at which observation was recordedduration - duration since the last observationpublic long getObservations()
public double getMean()
public long start()
start in class oracle.adfmf.performance.StopWatchpublic long start(long startTime)
start in class oracle.adfmf.performance.StopWatchstartTime - an actual start timepublic double stop()
stop in class oracle.adfmf.performance.StopWatchpublic String toString()
toString in class Objectpublic Object toJSON()
              throws Exception
JSONSerializabletoJSON in interface JSONSerializableException