|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectwt.util.CallRegistrar
public final class CallRegistrar
This class allows one body of code to quickly register the entry and exit of significant calls or states and another body of code to easily monitor the number and total duration of such occurrences on both a per thread and per CallRegistrar instance basis.
A single instance of this class should generally be created and held in a
static for an entire category of call statistic. For instance, a single
instance is held and exposed by RMICallRegistrar to enable
monitor of all RMI calls and their duration for the whole JVM.
Supported API: true
Extendable: false
| Constructor Summary | |
|---|---|
CallRegistrar()
/** Public constructor Supported API: true |
|
| Method Summary | |
|---|---|
long |
endCall(long startMillis)
Registers the completion of an call. |
int |
getActiveCalls()
Returns the number of active (in progress) registered calls. |
long |
getCallsForThread()
Returns the total number of calls which have been registered as having started by the current thread. |
long |
getCallsForThread(Thread thread)
Returns the total number of calls which have been registered as having started by the specified thread. |
long |
getElapsedTimeForThread()
Returns the elapsed time in milliseconds of calls which have been registered as having started by the current thread. |
long |
getElapsedTimeForThread(Thread thread)
Returns the elapsed time in milliseconds of calls which have been registered as having started by the specified thread. |
long |
getTotalCalls()
Returns the total number of calls (for all threads) which have been registered as having completed. |
long |
getTotalElapsedTime()
Returns the elapsed time in milliseconds of calls (for all threads) which have been registered as having completed. |
boolean |
isInCall()
Returns whether the current thread is in a registered call. |
boolean |
isInCall(Thread thread)
Returns whether the specified thread is in a registered call. |
long |
startCall()
Registers the start of an call. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CallRegistrar()
| Method Detail |
|---|
public boolean isInCall()
public boolean isInCall(Thread thread)
public int getActiveCalls()
public long getTotalCalls()
public long getCallsForThread()
public long getCallsForThread(Thread thread)
thread - the thread to get the call count forpublic long getTotalElapsedTime()
public long getElapsedTimeForThread()
public long getElapsedTimeForThread(Thread thread)
thread - the thread to get the elapsed call time forpublic long startCall()
public long endCall(long startMillis)
startMillis - the start time in milliseconds as returned by startCall()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||