intarsys runtime library

de.intarsys.tools.monitor
Class NullMonitor

java.lang.Object
  extended by de.intarsys.tools.monitor.NullMonitor
All Implemented Interfaces:
IMonitor

public class NullMonitor
extends Object
implements IMonitor

A monitor doing nothing...


Constructor Summary
NullMonitor(String name)
          Create a NullMonitor
 
Method Summary
 ITrace attach()
          Attach this IMonitor to the current Thread.
 void detach()
          Detach this IMonitor from the current Thread.
 int getActive()
           
 int getCollectAll()
           
 int getConcurrent()
           
 ITrace getCurrentTrace()
          Return an ITrace that is currently under construction.
 Map getData()
          A map containing key/value pairs representing all statistical informations derived from the samples.
 long getDifference()
           
 Map getFormattedData()
          A map containing key/value pairs with string representations for the statistical information from getData.
 String getFormattedStart()
           
 String getFormattedStop()
           
 Logger getLogger()
          The associated Logger instance.
 String getName()
          The name of this monitor.
 ISample getSample(String description)
           
 List getSamples()
           
 long getStart()
           
 long getStop()
           
 Map getTags()
           
 List getTraces()
          A list of ITrace instances.
 boolean isActive()
           
 void reset()
          Reset all information in this monitor.
 ISample sample(String description)
           
 void setCollectAll(int count)
           
 void setCollectExtremes(int count)
           
 void tag(String key, Object tag)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullMonitor

public NullMonitor(String name)
Create a NullMonitor

Parameters:
name - monitor name
Method Detail

attach

public ITrace attach()
Description copied from interface: IMonitor
Attach this IMonitor to the current Thread.

Calling this method indicates the beginning of a measuring period represented by a ITrace. This method must always be paired with a call to "detach()".

Specified by:
attach in interface IMonitor
Returns:
The new IMonitorTrace.

detach

public void detach()
Description copied from interface: IMonitor
Detach this IMonitor from the current Thread. This call terminates the current ITrace instance.

Specified by:
detach in interface IMonitor

getActive

public int getActive()

getCollectAll

public int getCollectAll()

getConcurrent

public int getConcurrent()

getCurrentTrace

public ITrace getCurrentTrace()
Description copied from interface: IMonitor
Return an ITrace that is currently under construction.

Specified by:
getCurrentTrace in interface IMonitor
Returns:
The ITrace that is currently under construction.

getData

public Map getData()
Description copied from interface: IMonitor
A map containing key/value pairs representing all statistical informations derived from the samples.

Specified by:
getData in interface IMonitor
Returns:
A map containing key/value pairs representing all statistical informations derived from the samples.

getDifference

public long getDifference()

getFormattedData

public Map getFormattedData()
Description copied from interface: IMonitor
A map containing key/value pairs with string representations for the statistical information from getData.

Specified by:
getFormattedData in interface IMonitor
Returns:
A map containing key/value pairs with string representations for the statistical information from getData.

getFormattedStart

public String getFormattedStart()

getFormattedStop

public String getFormattedStop()

getLogger

public Logger getLogger()
Description copied from interface: IMonitor
The associated Logger instance.

Specified by:
getLogger in interface IMonitor
Returns:
The associated Logger instance.

getName

public String getName()
Description copied from interface: IMonitor
The name of this monitor.

Specified by:
getName in interface IMonitor
Returns:
The name of this monitor.

getSample

public ISample getSample(String description)

getSamples

public List getSamples()

getStart

public long getStart()

getStop

public long getStop()

getTags

public Map getTags()

getTraces

public List getTraces()
Description copied from interface: IMonitor
A list of ITrace instances.

This may be null if no traces are stored (see setCollectAll()).

Specified by:
getTraces in interface IMonitor
Returns:
A list of ITrace instances.

isActive

public boolean isActive()

reset

public void reset()
Description copied from interface: IMonitor
Reset all information in this monitor.

Specified by:
reset in interface IMonitor

sample

public ISample sample(String description)

setCollectAll

public void setCollectAll(int count)

setCollectExtremes

public void setCollectExtremes(int count)

tag

public void tag(String key,
                Object tag)

intarsys runtime library

Copyright © 2012 intarsys consulting GmbH. All Rights Reserved.