public class MXBeanThreadProfiler extends java.lang.Object implements ThreadProfiler
ThreadMXBean
implementation to provide thread information.Constructor and Description |
---|
MXBeanThreadProfiler()
ThreadContentionMonitoring and ThreadCpuTime are both turned on when
constructing this class.
|
Modifier and Type | Method and Description |
---|---|
long |
getThreadCpuTime(long threadId)
Return the number of nanoseconds of CPU time used by the thread with the
given id.
|
long |
getThreadWaitTime(long threadId)
Return the number of nanoseconds of waiting time used by the thread with
the given id.
|
public MXBeanThreadProfiler()
ThreadMXBean
for more details.public long getThreadWaitTime(long threadId)
ThreadProfiler
getThreadWaitTime
in interface ThreadProfiler
threadId
- id of the target threadpublic long getThreadCpuTime(long threadId)
ThreadProfiler
getThreadCpuTime
in interface ThreadProfiler
threadId
- id of the target thread