net.sf.jperfprobe
Class DefaultProbe

java.lang.Object
  extended by net.sf.jperfprobe.DefaultProbe
All Implemented Interfaces:
Probe

public class DefaultProbe
extends Object
implements Probe

DefaultProbe implements a Probe. It is possible to start and stop a probe The probe is identified by a name. The probe uses nano seconds for measuring time.


Constructor Summary
  DefaultProbe(String name)
          Constructor of probe
protected DefaultProbe(String name, Time tim)
           
 
Method Summary
 void disable()
          Disable the probe.
 void enable()
          Enable the probe.
 long getElapsed()
          Get elapsed time for this probe in nanos.
 String getName()
          Get the name of the probe
 Time getTime()
           
 boolean isEnabled()
          Is the probe enabled.
 boolean isRunning()
          Is the probe running (by start).
 void setTime(Time time)
           
 void start()
          Start the probe.
 void stop()
          Stop the probe.
 String toString()
          Get all info from probe to string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultProbe

public DefaultProbe(String name)
Constructor of probe

Parameters:
name - name of probe

DefaultProbe

protected DefaultProbe(String name,
                       Time tim)
Method Detail

getElapsed

public long getElapsed()
Get elapsed time for this probe in nanos.

Specified by:
getElapsed in interface Probe
Returns:
elapsed time

start

public void start()
Start the probe. The probe will only start if it is enabled and not running. Nothing will happen if it is running.

Specified by:
start in interface Probe

stop

public void stop()
Stop the probe. It is not poosible to stop the probe if it is disabled

Specified by:
stop in interface Probe

isEnabled

public boolean isEnabled()
Is the probe enabled.

Specified by:
isEnabled in interface Probe
Returns:
enabled flag

enable

public void enable()
Enable the probe.

Specified by:
enable in interface Probe

disable

public void disable()
Disable the probe.

Specified by:
disable in interface Probe

isRunning

public boolean isRunning()
Is the probe running (by start).

Specified by:
isRunning in interface Probe
Returns:
running flag

getName

public String getName()
Description copied from interface: Probe
Get the name of the probe

Specified by:
getName in interface Probe
Returns:
name

getTime

public Time getTime()

setTime

public void setTime(Time time)

toString

public String toString()
Get all info from probe to string

Overrides:
toString in class Object
Returns:
string with all probe info


Copyright © 2004-2011. All Rights Reserved.