Package com.illumon.util.profiling
Class NullThreadProfiler
java.lang.Object
com.illumon.util.profiling.NullThreadProfiler
- All Implemented Interfaces:
ThreadProfiler
public final class NullThreadProfiler extends Object implements ThreadProfiler
The "null"
ThreadProfiler
implementation, which supports no actual measurements.-
Field Summary
Fields Modifier and Type Field Description static ThreadProfiler
INSTANCE
Fields inherited from interface com.illumon.util.profiling.ThreadProfiler
CPU_PROFILING_ENABLED, DEFAULT, MEMORY_PROFILING_ENABLED
-
Method Summary
Modifier and Type Method Description boolean
cpuProfilingAvailable()
Check if CPU profiling (e.g.long
getCurrentThreadAllocatedBytes()
Get the approximate number of total bytes allocated by the current thread.long
getCurrentThreadCpuTime()
Get the approximate number of total nanoseconds the current thread has executed (in system or user mode) since CPU time measurement started.long
getCurrentThreadUserTime()
Get the approximate number of total nanoseconds the current thread has executed (in user mode) since CPU time measurement started.boolean
memoryProfilingAvailable()
Check if memory profiling (e.g.
-
Field Details
-
Method Details
-
memoryProfilingAvailable
public boolean memoryProfilingAvailable()Description copied from interface:ThreadProfiler
Check if memory profiling (e.g.ThreadProfiler.getCurrentThreadAllocatedBytes()
) is available (supported and enabled).- Specified by:
memoryProfilingAvailable
in interfaceThreadProfiler
- 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.- Specified by:
getCurrentThreadAllocatedBytes
in interfaceThreadProfiler
- Returns:
- The approximate number of total bytes allocated by the current thread, or
QueryConstants.NULL_LONG
if unavailable.
-
cpuProfilingAvailable
public 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.
-