Package io.deephaven.util.profiling
Class ThreadMXBeanThreadProfiler<BEAN_TYPE extends ThreadMXBean>
java.lang.Object
io.deephaven.util.profiling.ThreadMXBeanThreadProfiler<BEAN_TYPE>
- All Implemented Interfaces:
ThreadProfiler
- Direct Known Subclasses:
BaselineThreadMXBeanThreadProfiler
,SunThreadMXBeanThreadProfiler
public abstract class ThreadMXBeanThreadProfiler<BEAN_TYPE extends ThreadMXBean>
extends Object
implements ThreadProfiler
An abstract generic
ThreadMXBean
-based ThreadProfiler
implementation, with support for baseline
measurements available on all JVMs.-
Field Summary
Fields inherited from interface io.deephaven.util.profiling.ThreadProfiler
CPU_PROFILING_ENABLED, DEFAULT, MEMORY_PROFILING_ENABLED
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Check if CPU profiling (e.g.final long
Get the approximate number of total nanoseconds the current thread has executed (in system or user mode) since CPU time measurement started.final long
Get the approximate number of total nanoseconds the current thread has executed (in user mode) since CPU time measurement started.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.deephaven.util.profiling.ThreadProfiler
getCurrentThreadAllocatedBytes, memoryProfilingAvailable
-
Field Details
-
threadMXBean
The bean for measurements.
-
-
Constructor Details
-
ThreadMXBeanThreadProfiler
protected ThreadMXBeanThreadProfiler()
-
-
Method Details
-
cpuProfilingAvailable
public final boolean cpuProfilingAvailable()Description copied from interface:ThreadProfiler
Check if CPU profiling (e.g.ThreadProfiler.getCurrentThreadCpuTime()
andThreadProfiler.getCurrentThreadUserTime()
) is available (supported and enabled).- Specified by:
cpuProfilingAvailable
in interfaceThreadProfiler
- Returns:
- Whether CPU profiling is available.
-
getCurrentThreadCpuTime
public final long getCurrentThreadCpuTime()Description copied from interface:ThreadProfiler
Get the approximate number of total nanoseconds the current thread has executed (in system or user mode) since CPU time measurement started.- Specified by:
getCurrentThreadCpuTime
in interfaceThreadProfiler
- Returns:
- The approximate number of total nanoseconds the current thread has executed, or
QueryConstants.NULL_LONG
if unavailable.
-
getCurrentThreadUserTime
public final long getCurrentThreadUserTime()Description copied from interface:ThreadProfiler
Get the approximate number of total nanoseconds the current thread has executed (in user mode) since CPU time measurement started.- Specified by:
getCurrentThreadUserTime
in interfaceThreadProfiler
- Returns:
- The approximate number of total nanoseconds the current thread has executed in user mode, or
QueryConstants.NULL_LONG
if unavailable.
-