Class TimerFactory
java.lang.Object
com.google.apphosting.runtime.timer.TimerFactory
TimerFactory creates new Timer instances.-
Constructor Summary
ConstructorsConstructorDescriptionTimerFactory(long cyclesPerSecond, TimerSet... timerSets) Create aTimerFactory. -
Method Summary
Modifier and TypeMethodDescriptiongetCpuCycleTimer(Thread thread) Return aTimerthat counts CPU time for the specifiedThread.getCpuRatioTimer(Thread thread) Returns aCpuRatioTimerthat tracks both the CPU usage of the specifiedThreadand the wallclock time.getCpuRatioTimer(ThreadGroup threadGroup) Returns aCpuRatioTimerthat tracks both the CPU usage of the specifiedThreadGroupand the wallclock time.getThreadGroupCpuTimer(ThreadGroup threadGroup) Return aTimerthat counts wallclock time.
-
Constructor Details
-
TimerFactory
Create aTimerFactory.- Parameters:
cyclesPerSecond- Speed of the processor in clock cycles per secondtimerSets- Zero or moreTimerSetinstances that will become additional timers associated with the returnedCpuRatioTimer. This is useful for tracking CPU usage outside of a request thread, such as hotspot or GC.
-
-
Method Details
-
getWallclockTimer
Return aTimerthat counts wallclock time. -
getCpuCycleTimer
Return aTimerthat counts CPU time for the specifiedThread.- Throws:
UnsupportedOperationException- If no CPU timer is available.
-
getThreadGroupCpuTimer
-
getCpuRatioTimer
Returns aCpuRatioTimerthat tracks both the CPU usage of the specifiedThreadand the wallclock time.- Throws:
UnsupportedOperationException- If thread CPU timing is not available.
-
getCpuRatioTimer
Returns aCpuRatioTimerthat tracks both the CPU usage of the specifiedThreadGroupand the wallclock time.- Throws:
UnsupportedOperationException- If thread CPU timing is not available.
-