Package io.deephaven.util.profiling
Interface ThreadProfiler
- All Known Implementing Classes:
BaselineThreadMXBeanThreadProfiler
,NullThreadProfiler
,SunThreadMXBeanThreadProfiler
,ThreadMXBeanThreadProfiler
public interface ThreadProfiler
Interface for thread profiling utilities which may be platform or JVM dependent.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final boolean
static final ThreadProfiler
Default instance for almost all usage.static final boolean
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Check if CPU profiling (e.g.long
Get the approximate number of total bytes allocated by the current thread.long
Get the approximate number of total nanoseconds the current thread has executed (in system or user mode) since CPU time measurement started.long
Get the approximate number of total nanoseconds the current thread has executed (in user mode) since CPU time measurement started.static ThreadProfiler
make()
Make a new ThreadProfiler for this JVM.boolean
Check if memory profiling (e.g.
-
Field Details
-
CPU_PROFILING_ENABLED
static final boolean CPU_PROFILING_ENABLED -
MEMORY_PROFILING_ENABLED
static final boolean MEMORY_PROFILING_ENABLED -
DEFAULT
Default instance for almost all usage.
-
-
Method Details
-
memoryProfilingAvailable
boolean memoryProfilingAvailable()Check if memory profiling (e.g.getCurrentThreadAllocatedBytes()
) is available (supported and enabled).- Returns:
- Whether memory profiling is available.
-
getCurrentThreadAllocatedBytes
long getCurrentThreadAllocatedBytes()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.
-
cpuProfilingAvailable
boolean cpuProfilingAvailable()Check if CPU profiling (e.g.getCurrentThreadCpuTime()
andgetCurrentThreadUserTime()
) is available (supported and enabled).- Returns:
- Whether CPU profiling is available.
-
getCurrentThreadCpuTime
long getCurrentThreadCpuTime()Get the approximate number of total nanoseconds the current thread has executed (in system or user mode) since CPU time measurement started.- Returns:
- The approximate number of total nanoseconds the current thread has executed, or
QueryConstants.NULL_LONG
if unavailable.
-
getCurrentThreadUserTime
long getCurrentThreadUserTime()Get the approximate number of total nanoseconds the current thread has executed (in user mode) since CPU time measurement started.- Returns:
- The approximate number of total nanoseconds the current thread has executed in user mode, or
QueryConstants.NULL_LONG
if unavailable.
-
make
Make a new ThreadProfiler for this JVM. The result may not support all measurements, if there's no suitable implementation available.- Returns:
- A new ThreadProfiler for this JVM.
-