public class TimerImpl extends Timer
DUMMY_TIMERLAZY_NOUN_TYPE, mEnableDms, mEnablePerfLog, mIndex, mLevel, mSensorFullName, sIdxLogger, sLogger| Modifier and Type | Method and Description |
|---|---|
void |
cleanup()
Cleanup the timer.
|
void |
cleanupWithToken(TimerToken tok)
Cleanup the timer using token.
|
static Timer |
createDMSTimer(java.util.logging.Level level,
java.lang.String groupName,
java.lang.String name,
java.lang.String type,
java.lang.String desc,
TimerProvider provider,
oracle.dms.instrument.SegregationType sgType)
Create a Timer object identified by the groupName, the name, the type,
and the description.
|
void |
destroy()
destroy up the metrics value
|
protected long |
getElapsedTime()
Access how much elapese time in ms of DMS timer object.
|
void |
reset()
Clean up the metrics value
|
void |
start()
Start the timer.
|
TimerToken |
startWithToken()
Start the timer using Token.
|
void |
stop()
Stop the timer.
|
void |
stop(int returnValue)
Stop the timer with specified returnValue
|
void |
stop(java.lang.Object returnValue)
Stop the timer with specified returnValue
|
void |
stopWithToken(TimerToken tok)
Stop the timer using token.
|
void |
stopWithToken(TimerToken token,
int returnValue)
Stop the timer using token with specified returnValue
|
void |
stopWithToken(TimerToken token,
java.lang.Object returnValue)
Stop the timer using token with specified returnValue
|
createTimer, createTimer, createTimer, createTimer, createTimerisActive, log, toStringpublic static Timer createDMSTimer(java.util.logging.Level level, java.lang.String groupName, java.lang.String name, java.lang.String type, java.lang.String desc, TimerProvider provider, oracle.dms.instrument.SegregationType sgType)
Developers should then call Timer's start(), stop() and cleanup() functions to track the time. Please note start()/stop() funtions should always be put in a try or catch block, and the cleanup() function should always be called in a finally block to make sure the Timer object is aborted cleanly in case stop() is not called.
Internally, this method creates a DMS PhaseEvent sensor.
A DMS PhaseEvent sensor has following metrics: active, avg, completed, maxActive, maxTime, minTime and time.
When called inside the IDE, always returns DUMMY_TIMER.
level - one of the message level identifiers, e.g. SEVEREgroupName - the group name, which has the format of
/oracle/component_id/module/subModule/...name - the timer nametype - the timer type which collects all sensors
with same type and display them together in a table
in AggreSpydesc - the description for this timer.provider - the timer provider implements TimerProvidersgType - SegregationType type value used for multitenant partition typepublic void start()
TimerAfter a timer is started, developers should call stop() function to stop the timer. start()/stop() funtions should be put in a try block, and the cleanup() function should be called in a finally block.
Internally, this method starts the DMS PhaseEvent sensor. The DMS PhaseEvent sensor has following metrics: active, avg, completed, maxActive, maxTime, minTime and time.
public TimerToken startWithToken()
TimerAfter a timer is started, developer should call stopWithToken(token) and cleanupWithToken(token) function to stop and cleanup the timer.
Internally, this method starts the DMS PhaseEvent sensor. The DMS PhaseEvent sensor has following metrics: active, avg, completed, maxActive, maxTime, minTime and time.
startWithToken in class Timerpublic void stop()
TimerDeveloper should call start() function to start the timer. start()/stop() functions should be put in a try block, and the cleanup() function should be called in a finally block.
Internally, this method stops the DMS PhaseEvent sensor. The DMS PhaseEvent sensor has following metrics: active, avg, completed, maxActive, maxTime, minTime and time.
public void stopWithToken(TimerToken tok)
TimerDeveloper should call startWithToken() function to start the timer, and then call this method to stop the timer
Internally, this method stops the DMS PhaseEvent sensor. The DMS PhaseEvent sensor has following metrics: active, avg, completed, maxActive, maxTime, minTime and time.
stopWithToken in class Timertok - the TimerToken returned from startWithToken()public void stop(int returnValue)
TimerDeveloper should call start() function to start the timer with TimerProvider, and stop(returnValue) to stop the timer. The returnValue decides which children timers to be updated.
Internally, this method stops the DMS PhaseEvent sensor for the parent sensor, and then update each children's PhaseEvent based on the result from TimerProvider.getTimers().
The DMS PhaseEvent sensor has following metrics: active, avg, completed, maxActive, maxTime, minTime and time.
public void stopWithToken(TimerToken token, int returnValue)
TimerDeveloper should call startWithToken() function to start the timer with TimerProvider, and stopWithToken(token, returnValue) to stop the timer. The returnValue decides which children timers to be updated.
Internally, this method stops the DMS PhaseEvent sensor for the parent sensor, and then update each children's PhaseEvent based on the result from TimerProvider.getTimers().
The DMS PhaseEvent sensor has following metrics: active, avg, completed, maxActive, maxTime, minTime and time.
stopWithToken in class Timertoken - the TimerToken returned from startWithToken()returnValue - the return code from a piece of code being monitored.public void stop(java.lang.Object returnValue)
TimerDeveloper should call start() function to start the timer with TimerProvider, and stop(returnValue) to stop the timer. The returnValue decides which children timers to be updated.
Internally, this method stops the DMS PhaseEvent sensor for the parent sensor, and then update each children's PhaseEvent based on the result from TimerProvider.getTimers().
The DMS PhaseEvent sensor has following metrics: active, avg, completed, maxActive, maxTime, minTime and time.
public void stopWithToken(TimerToken token, java.lang.Object returnValue)
TimerDeveloper should call startWithToken() function to start the timer with TimerProvider, and stopWithToken(token, returnValue) to stop the timer. The returnValue decides which children timers to be updated.
Internally, this method stops the DMS PhaseEvent sensor for the parent sensor, and then update each children's PhaseEvent based on the result from TimerProvider.getTimers().
The DMS PhaseEvent sensor has following metrics: active, avg, completed, maxActive, maxTime, minTime and time.
stopWithToken in class Timertoken - the TimerToken returned from startWithToken()returnValue - the return code from a piece of code being monitored.public void cleanup()
TimerThis function should be called within a finally block. It either stops the timer if everything goes fine, or aborts the timer if an exception occurred.
public void cleanupWithToken(TimerToken tok)
TimerThis function should be called within a finally block. It either stops the timer if everything goes fine, or aborts the timer if an exception occurred.
cleanupWithToken in class Timertok - the TimerToken returned from startWithToken()public void reset()
ADFPerfSensorreset in class ADFPerfSensorpublic void destroy()
ADFPerfSensordestroy in class ADFPerfSensorprotected long getElapsedTime()
TimergetElapsedTime in class Timer