public class TimerFactory extends Object
TimerFactory creates new Timer instances.| Constructor and Description |
|---|
TimerFactory(long cyclesPerSecond,
TimerSet... timerSets)
Create a
TimerFactory. |
| Modifier and Type | Method and Description |
|---|---|
Timer |
getCpuCycleTimer(Thread thread)
Return a
Timer that counts CPU time for the specified
Thread. |
CpuRatioTimer |
getCpuRatioTimer(Thread thread)
Returns a
CpuRatioTimer that tracks both the CPU usage of
the specified Thread and the wallclock time. |
CpuRatioTimer |
getCpuRatioTimer(ThreadGroup threadGroup)
Returns a
CpuRatioTimer that tracks both the CPU usage of
the specified ThreadGroup and the wallclock time. |
Timer |
getThreadGroupCpuTimer(ThreadGroup threadGroup) |
Timer |
getWallclockTimer()
Return a
Timer that counts wallclock time. |
public TimerFactory(long cyclesPerSecond,
TimerSet... timerSets)
TimerFactory.cyclesPerSecond - Speed of the processor in clock cycles per secondtimerSets - Zero or more TimerSet instances that
will become additional timers associated with the returned
CpuRatioTimer. This is useful for tracking CPU usage
outside of a request thread, such as hotspot or GC.public Timer getWallclockTimer()
Timer that counts wallclock time.public Timer getCpuCycleTimer(Thread thread)
Timer that counts CPU time for the specified
Thread.UnsupportedOperationException - If no CPU timer is available.public Timer getThreadGroupCpuTimer(ThreadGroup threadGroup)
public CpuRatioTimer getCpuRatioTimer(Thread thread)
CpuRatioTimer that tracks both the CPU usage of
the specified Thread and the wallclock time.UnsupportedOperationException - If thread CPU timing is not
available.public CpuRatioTimer getCpuRatioTimer(ThreadGroup threadGroup)
CpuRatioTimer that tracks both the CPU usage of
the specified ThreadGroup and the wallclock time.UnsupportedOperationException - If thread CPU timing is not
available.Copyright © 2022. All rights reserved.