com.waveset.util
Class CallTimer

java.lang.Object
  extended bycom.waveset.util.AbstractXmlObject
      extended bycom.waveset.util.CallTimer
All Implemented Interfaces:
javax.naming.Referenceable, XmlObject

public class CallTimer
extends AbstractXmlObject

Records call statistics for Lighthouse methods.


Field Summary
static java.lang.String CLASS
           
static java.lang.String code_id
           
static java.lang.String ELEMENT
           
 
Fields inherited from class com.waveset.util.AbstractXmlObject
_trace
 
Method Summary
static void clear()
          Discard all data about known methods (including statistics, calling relationships and the methods themselves).
static void entry(java.lang.String methodName)
          Records a call to the specified method.
static void entry(java.lang.String methodName, long timeMillis)
          Records a call to the specified method at the specified time.
static void exception(java.lang.String methodName)
          Records exceptional exit from the specified method.
static void exception(java.lang.String methodName, long timeMillis)
          Records exceptional exit from the specified method at the specified time.
static void exit(java.lang.String methodName)
          Records normal exit from the specified method.
static void exit(java.lang.String methodName, long timeMillis)
          Records normal exit from the specified method at the specified time.
 void fromXml(org.w3c.dom.Element e)
          De-Serialize the call timer from an XML Element
 void fromXml(java.lang.String data)
          De-Serialize the call timer from an XML string data
static CallTimer getCallTimer()
           
 java.lang.String getElementName()
          Return the element name.
static java.lang.String getRequestor()
           
static long getStartTime()
           
static CallStatistics[] getStatistics()
           
static CallStatistics getStatistics(java.lang.String methodName)
           
static CallStatistics getStatistics(java.lang.String methodName, java.lang.String caller)
           
static long getStopTime()
           
static void info(java.lang.String methodName)
          Records a call to trace (e.g., to Trace.info(long, java.lang.Class, java.lang.String, java.lang.String)) from within a specified method.
static void info(java.lang.String methodName, long timeMillis)
          Records a call to trace (e.g., to Trace.info(long, java.lang.Class, java.lang.String, java.lang.String)) from within the specified method at the specified time.
static boolean isCurrentlyTiming()
           
static java.util.List listCalledBy(java.lang.String methodName)
           
static java.util.List listCallersOf(java.lang.String methodName)
           
static java.util.List listMethodNames()
           
static java.util.List listThreads()
           
static void start(java.lang.String requestor)
           
static void stop(java.lang.String requestor)
           
 void toXml(java.lang.StringBuffer b, int indent)
          Serialize the call timer to an XML string buffer.
 
Methods inherited from class com.waveset.util.AbstractXmlObject
addXmlHeader, cloneObject, dump, dumpFile, getReference, println, setTrace, toIdentityString, toVerboseString, toVerboseString, toXml, toXml, toXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values

CLASS

public static final java.lang.String CLASS
See Also:
Constant Field Values

ELEMENT

public static final java.lang.String ELEMENT
See Also:
Constant Field Values
Method Detail

isCurrentlyTiming

public static boolean isCurrentlyTiming()

getStartTime

public static long getStartTime()

getStopTime

public static long getStopTime()

getRequestor

public static java.lang.String getRequestor()

getCallTimer

public static CallTimer getCallTimer()

entry

public static void entry(java.lang.String methodName)
Records a call to the specified method.


entry

public static void entry(java.lang.String methodName,
                         long timeMillis)
Records a call to the specified method at the specified time.


info

public static void info(java.lang.String methodName)
Records a call to trace (e.g., to Trace.info(long, java.lang.Class, java.lang.String, java.lang.String)) from within a specified method.


info

public static void info(java.lang.String methodName,
                        long timeMillis)
Records a call to trace (e.g., to Trace.info(long, java.lang.Class, java.lang.String, java.lang.String)) from within the specified method at the specified time.


exception

public static void exception(java.lang.String methodName)
Records exceptional exit from the specified method.


exception

public static void exception(java.lang.String methodName,
                             long timeMillis)
Records exceptional exit from the specified method at the specified time.


exit

public static void exit(java.lang.String methodName)
Records normal exit from the specified method.


exit

public static void exit(java.lang.String methodName,
                        long timeMillis)
Records normal exit from the specified method at the specified time.


getStatistics

public static CallStatistics[] getStatistics()
Returns:
aggregate call statistics for each method.

Aggregate statistics are summary timings for all callers of a method.


getStatistics

public static CallStatistics getStatistics(java.lang.String methodName)
Returns:
aggregate call statistics for the specified method.

Aggregate statistics are summary timings for all callers of a method.


getStatistics

public static CallStatistics getStatistics(java.lang.String methodName,
                                           java.lang.String caller)
Returns:
caller-specific call statistics for the specified method and caller.

Caller-specific statistics are timings of the specified method when called by the specified caller.


listMethodNames

public static java.util.List listMethodNames()
Returns:
a list of methods that call the specified method. Each element in the List is a String.

listCallersOf

public static java.util.List listCallersOf(java.lang.String methodName)
Returns:
a list of methods that call the specified method. Each element in the List is a String.

listCalledBy

public static java.util.List listCalledBy(java.lang.String methodName)
Returns:
a list of methods that the specified method calls. Each element in the List is a String.

listThreads

public static java.util.List listThreads()
Returns:
a list of Threads for which we've tracked calls. Each element in the List is a Thread.

clear

public static void clear()
Discard all data about known methods (including statistics, calling relationships and the methods themselves).

To clear statistics (but leave the known methods and their calling relationships), see #resetStatistics.

To clear statistics and calling relationships (but leave alone the set of known methods), see #resetCallingRelationships.

Execution of the product automatically rebuilds this information incrementally the product code executes (unless configuration disables this).


start

public static void start(java.lang.String requestor)

stop

public static void stop(java.lang.String requestor)

getElementName

public java.lang.String getElementName()
Description copied from class: AbstractXmlObject
Return the element name.

Specified by:
getElementName in interface XmlObject
Specified by:
getElementName in class AbstractXmlObject

fromXml

public void fromXml(java.lang.String data)
             throws WavesetException
De-Serialize the call timer from an XML string data

Throws:
WavesetException

fromXml

public void fromXml(org.w3c.dom.Element e)
             throws WavesetException
De-Serialize the call timer from an XML Element

Throws:
WavesetException

toXml

public void toXml(java.lang.StringBuffer b,
                  int indent)
Serialize the call timer to an XML string buffer.

Specified by:
toXml in interface XmlObject
Specified by:
toXml in class AbstractXmlObject