Class CallRegistrar
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongendCall(long startMillis) Deprecated.longendCallNanos(long startNanos) Registers the completion of an call and returns the elapsed time in nanoseconds.intReturns the number of active (in progress) registered calls.longReturns the total number of calls which have been registered as having started by the current thread.longgetCallsForThread(Thread thread) Returns the total number of calls which have been registered as having started by the specified thread.longReturns the elapsed time in milliseconds of calls which have been registered as having started by the current thread.longgetElapsedMillisForThread(Thread thread) Returns the elapsed time in milliseconds of calls which have been registered as having started by the specified thread.longReturns the elapsed time in nanoseconds of calls which have been registered as having started by the current thread.longgetElapsedNanosForThread(Thread thread) Returns the elapsed time in nanoseconds of calls which have been registered as having started by the specified thread.longDeprecated.longgetElapsedTimeForThread(Thread thread) Deprecated.longReturns the total number of calls (for all threads) which have been registered as having completed.longReturns the elapsed time in microseconds of calls (for all threads) which have been registered as having completed.longReturns the elapsed time in milliseconds of calls (for all threads) which have been registered as having completed.longDeprecated.booleanisInCall()Returns whether the current thread is in a registered call.booleanReturns whether the specified thread is in a registered call.longDeprecated.longRegisters the start of an call and returns start time as per System.nanoTime().
-
Constructor Details
-
CallRegistrar
public CallRegistrar()Public constructor
Supported API: true
-
-
Method Details
-
isInCall
public boolean isInCall()Returns whether the current thread is in a registered call.
Supported API: true -
isInCall
Returns whether the specified thread is in a registered call.
Supported API: true -
getActiveCalls
public int getActiveCalls()Returns the number of active (in progress) registered calls.
Supported API: true -
getTotalCalls
public long getTotalCalls()Returns the total number of calls (for all threads) which have been registered as having completed.
Supported API: true -
getCallsForThread
public long getCallsForThread()Returns the total number of calls which have been registered as having started by the current thread.
Supported API: true -
getCallsForThread
Returns the total number of calls which have been registered as having started by the specified thread.
Supported API: true- Parameters:
thread- the thread to get the call count for
-
getTotalElapsedTime
Deprecated.Synonym for getTotalElapsedMillis().While this method is maintained for backwards compatibility, it is advsiable to use the more explicit getTotalElapsedMillis() method.
Supported API: true -
getTotalElapsedMillis
public long getTotalElapsedMillis()Returns the elapsed time in milliseconds of calls (for all threads) which have been registered as having completed.
Supported API: true -
getTotalElapsedMicros
public long getTotalElapsedMicros()Returns the elapsed time in microseconds of calls (for all threads) which have been registered as having completed.
Supported API: true -
getElapsedTimeForThread
Deprecated.Synonym for getElapsedMillisForThread().While this method is maintained for backwards compatibility, it is advsiable to use the more explicit getElapsedMillisForThread() method.
Supported API: true -
getElapsedTimeForThread
Deprecated.Synonym for getElapsedMillisForThread(Thread).While this method is maintained for backwards compatibility, it is advsiable to use the more explicit getElapsedMillisForThread(Thread) method.
Supported API: true -
getElapsedMillisForThread
public long getElapsedMillisForThread()Returns the elapsed time in milliseconds of calls which have been registered as having started by the current thread.
Supported API: true -
getElapsedMillisForThread
Returns the elapsed time in milliseconds of calls which have been registered as having started by the specified thread.
Supported API: true- Parameters:
thread- the thread to get the elapsed call time for
-
getElapsedNanosForThread
public long getElapsedNanosForThread()Returns the elapsed time in nanoseconds of calls which have been registered as having started by the current thread.
Supported API: true -
getElapsedNanosForThread
Returns the elapsed time in nanoseconds of calls which have been registered as having started by the specified thread.
Supported API: true- Parameters:
thread- the thread to get the elapsed call time for
-
startCall
Deprecated.Registers the start of an call and returns start time as per System.currentTimeMillis().This method is only retained for compatibility. startCallNanos() should be used instead.
Supported API: true- Returns:
- the start time in milliseconds; must be passed to endCall()
-
startCallNanos
public long startCallNanos()Registers the start of an call and returns start time as per System.nanoTime().
Supported API: true- Returns:
- the start time in nanoseconds; must be passed to endCallNanos(long)
-
endCall
Deprecated.Registers the completion of an call and returns the elapsed time in milliseconds.This method is only retained for compatibility. endCallNanos(long) should be used instead.
Supported API: true- Parameters:
startMillis- the start time in milliseconds as returned by startCall()- Returns:
- the elapsed time of the call in milliseconds
-
endCallNanos
public long endCallNanos(long startNanos) Registers the completion of an call and returns the elapsed time in nanoseconds.
Supported API: true- Parameters:
startNanos- the start time in nanoseconds as returned by startCallNanos()- Returns:
- the elapsed time of the call in nanoseconds
-