public abstract class Profiler
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
Profiler.MBeanValueProvider
Helper interface to make accessing a Profiler as an MBean
type safe.
|
static class |
Profiler.Record
Record represents an atomic unit in the application execution call tree
|
static class |
Profiler.Snapshot
Snapshot is an immutable image of the current profiling data collected
by the Profiler
It is created by calling snapshot() method |
Modifier and Type | Field and Description |
---|---|
long |
START_TIME
This property exposes the time of creating this particular Profiler instance.
|
Constructor and Description |
---|
Profiler()
Creates a new Profiler instance
|
Modifier and Type | Method and Description |
---|---|
abstract void |
recordEntry(java.lang.String blockName)
Records the event of entering an execution unit (eg.
|
abstract void |
recordExit(java.lang.String blockName,
long duration)
Records the event of exiting an execution unit (eg.
|
abstract void |
reset()
Resets all the collected data
|
Profiler.Snapshot |
snapshot()
Creates an immutable snapshot of the collected profiling data
|
abstract Profiler.Snapshot |
snapshot(boolean reset)
Creates an immutable snapshot of the collected profiling data.
Makes it possible to reset the profiler after creating the snapshot, eventually |
public final long START_TIME
public Profiler()
public abstract void recordEntry(java.lang.String blockName)
blockName
- The execution unit identifier (eg. method FQN)public abstract void recordExit(java.lang.String blockName, long duration)
blockName
- The execution unit identifier (eg. method FQN)duration
- Invocation duration in nanosecondspublic final Profiler.Snapshot snapshot()
public abstract Profiler.Snapshot snapshot(boolean reset)
reset
- Signals the profiler to perform reset right after getting the snapshot (in an atomic transaction)public abstract void reset()