public static class BTraceUtils.Profiling
extends java.lang.Object
Constructor and Description |
---|
BTraceUtils.Profiling() |
Modifier and Type | Method and Description |
---|---|
static Profiler |
newProfiler()
Creates a new Profiler instance
|
static Profiler |
newProfiler(int expectedBlockCnt)
Creates a new Profiler instance with the specified
expected count of the distinct methods to be recorded.
|
static void |
printSnapshot(java.lang.String name,
Profiler profiler) |
static void |
printSnapshot(java.lang.String name,
Profiler profiler,
java.lang.String format) |
static void |
recordEntry(Profiler profiler,
java.lang.String blockName)
Records the entry to a particular code block
|
static void |
recordExit(Profiler profiler,
java.lang.String blockName,
long duration)
Records the exit out of a particular code block
|
static void |
reset(Profiler profiler) |
static Profiler.Snapshot |
snapshot(Profiler profiler)
Creates a new snapshot of the profiling metrics collected sofar
|
static Profiler.Snapshot |
snapshotAndReset(Profiler profiler) |
public static Profiler newProfiler()
public static Profiler newProfiler(int expectedBlockCnt)
expectedBlockCnt
- The expected count of the distinct blocks
to be recorded.public static void recordEntry(Profiler profiler, java.lang.String blockName)
profiler
- The Profiler instance to useblockName
- The block identifierpublic static void recordExit(Profiler profiler, java.lang.String blockName, long duration)
profiler
- The Profiler instance to useblockName
- The block identifierduration
- The time spent in the mentioned blockpublic static Profiler.Snapshot snapshot(Profiler profiler)
profiler
- The Profiler instance to usepublic static Profiler.Snapshot snapshotAndReset(Profiler profiler)
public static void reset(Profiler profiler)
public static void printSnapshot(java.lang.String name, Profiler profiler)
public static void printSnapshot(java.lang.String name, Profiler profiler, java.lang.String format)