Package com.illumon.util.profiling
Class NullThreadProfiler
java.lang.Object
com.illumon.util.profiling.NullThreadProfiler
- All Implemented Interfaces:
ThreadProfiler
The "null"
ThreadProfiler implementation, which supports no actual measurements.-
Field Summary
FieldsFields inherited from interface com.illumon.util.profiling.ThreadProfiler
CPU_PROFILING_ENABLED, DEFAULT, MEMORY_PROFILING_ENABLED -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck if CPU profiling (e.g.final longGet the approximate number of total bytes allocated by the current thread.final longGet the approximate number of total nanoseconds the current thread has executed (in system or user mode) since CPU time measurement started.final longGet the approximate number of total nanoseconds the current thread has executed (in user mode) since CPU time measurement started.booleanCheck if memory profiling (e.g.
-
Field Details
-
INSTANCE
-
-
Method Details
-
memoryProfilingAvailable
public boolean memoryProfilingAvailable()Description copied from interface:ThreadProfilerCheck if memory profiling (e.g.ThreadProfiler.getCurrentThreadAllocatedBytes()) is available (supported and enabled).- Specified by:
memoryProfilingAvailablein interfaceThreadProfiler- Returns:
- Whether memory profiling is available.
-
getCurrentThreadAllocatedBytes
public final long getCurrentThreadAllocatedBytes()Description copied from interface:ThreadProfilerGet the approximate number of total bytes allocated by the current thread.- Specified by:
getCurrentThreadAllocatedBytesin interfaceThreadProfiler- Returns:
- The approximate number of total bytes allocated by the current thread, or
QueryConstants.NULL_LONGif unavailable.
-
cpuProfilingAvailable
public boolean cpuProfilingAvailable()Description copied from interface:ThreadProfilerCheck if CPU profiling (e.g.ThreadProfiler.getCurrentThreadCpuTime()andThreadProfiler.getCurrentThreadUserTime()) is available (supported and enabled).- Specified by:
cpuProfilingAvailablein interfaceThreadProfiler- Returns:
- Whether CPU profiling is available.
-
getCurrentThreadCpuTime
public final long getCurrentThreadCpuTime()Description copied from interface:ThreadProfilerGet the approximate number of total nanoseconds the current thread has executed (in system or user mode) since CPU time measurement started.- Specified by:
getCurrentThreadCpuTimein interfaceThreadProfiler- Returns:
- The approximate number of total nanoseconds the current thread has executed, or
QueryConstants.NULL_LONGif unavailable.
-
getCurrentThreadUserTime
public final long getCurrentThreadUserTime()Description copied from interface:ThreadProfilerGet the approximate number of total nanoseconds the current thread has executed (in user mode) since CPU time measurement started.- Specified by:
getCurrentThreadUserTimein interfaceThreadProfiler- Returns:
- The approximate number of total nanoseconds the current thread has executed in user mode, or
QueryConstants.NULL_LONGif unavailable.
-