Package com.illumon.util.profiling
Class SunThreadMXBeanThreadProfiler
java.lang.Object
com.illumon.util.profiling.ThreadMXBeanThreadProfiler<ThreadMXBean>
com.illumon.util.profiling.SunThreadMXBeanThreadProfiler
- All Implemented Interfaces:
ThreadProfiler
public final class SunThreadMXBeanThreadProfiler extends ThreadMXBeanThreadProfiler<ThreadMXBean>
A
ThreadMXBean
-based ThreadProfiler
implementation for use on Oracle and OpenJDK JVMs, adding support
for memory measurements.-
Field Summary
Fields inherited from interface com.illumon.util.profiling.ThreadProfiler
CPU_PROFILING_ENABLED, DEFAULT, MEMORY_PROFILING_ENABLED
-
Constructor Summary
Constructors Constructor Description SunThreadMXBeanThreadProfiler()
-
Method Summary
Modifier and Type Method Description long
getCurrentThreadAllocatedBytes()
Get the approximate number of total bytes allocated by the current thread.boolean
memoryProfilingAvailable()
Check if memory profiling (e.g.Methods inherited from class com.illumon.util.profiling.ThreadMXBeanThreadProfiler
cpuProfilingAvailable, getCurrentThreadCpuTime, getCurrentThreadUserTime
-
Constructor Details
-
SunThreadMXBeanThreadProfiler
public SunThreadMXBeanThreadProfiler()
-
-
Method Details
-
memoryProfilingAvailable
public final boolean memoryProfilingAvailable()Description copied from interface:ThreadProfiler
Check if memory profiling (e.g.ThreadProfiler.getCurrentThreadAllocatedBytes()
) is available (supported and enabled).- Returns:
- Whether memory profiling is available.
-
getCurrentThreadAllocatedBytes
public final long getCurrentThreadAllocatedBytes()Description copied from interface:ThreadProfiler
Get the approximate number of total bytes allocated by the current thread.- Returns:
- The approximate number of total bytes allocated by the current thread, or
QueryConstants.NULL_LONG
if unavailable.
-