public class MethodInvocationProfiler extends Profiler implements Profiler.MBeanValueProvider
Profiler.MBeanValueProvider, Profiler.Record, Profiler.Snapshot
START_TIME
Constructor and Description |
---|
MethodInvocationProfiler(int expectedMethodCnt) |
Modifier and Type | Method and Description |
---|---|
Profiler.Snapshot |
getMBeanValue() |
void |
recordEntry(java.lang.String blockName)
Records the event of entering an execution unit (eg.
|
void |
recordExit(java.lang.String blockName,
long duration)
Records the event of exiting an execution unit (eg.
|
void |
reset()
Resets all the collected data
|
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 void recordEntry(java.lang.String blockName)
Profiler
recordEntry
in class Profiler
blockName
- The execution unit identifier (eg. method FQN)public void recordExit(java.lang.String blockName, long duration)
Profiler
recordExit
in class Profiler
blockName
- The execution unit identifier (eg. method FQN)duration
- Invocation duration in nanosecondspublic void reset()
Profiler
public Profiler.Snapshot snapshot(boolean reset)
Profiler
snapshot
in class Profiler
reset
- Signals the profiler to perform reset right after getting the snapshot (in an atomic transaction)public Profiler.Snapshot getMBeanValue()
getMBeanValue
in interface Profiler.MBeanValueProvider