public final class Profile
extends java.lang.Object
implements java.lang.Runnable
Profiler
is the class that actually profiles the code.
Code to be profiled is instrumented, when the byte code is loaded,
to make calls to this class:
Profiler.start())
Profiler.end())
Profiler.end())
Note: Instrumenting code can interfer with line numbers that are added to
the code for debugging. If you are debugging code and your stack traces
don't have line numbers, don't use the profiler (ie, don't use
-javaagent)
Constructor and Description |
---|
Profile() |
Modifier and Type | Method and Description |
---|---|
static void |
alloc(java.lang.String className) |
static java.lang.Iterable<ClassAllocation> |
allocations() |
static void |
beginWait(java.lang.String className,
java.lang.String methodName) |
static void |
clear() |
static void |
end(java.lang.String className,
java.lang.String method) |
static void |
endWait(java.lang.String className,
java.lang.String methodName) |
static java.lang.Iterable<Frame> |
frameList() |
static long |
getThreadTotalTime(long threadId) |
static void |
init() |
static void |
initProfiler() |
static java.lang.Iterable<Frame> |
interactions(long threadId) |
void |
run()
ShutdownHook: This will dump the profiling info when the VM shutsdown.
|
static void |
setFileName(java.lang.String fileName) |
static void |
shutdown() |
static void |
sortFrameList(java.util.Comparator<Frame> comp) |
static void |
start() |
static void |
start(java.lang.String className,
java.lang.String methodName) |
static void |
stop() |
static java.lang.Iterable<java.lang.Long> |
threads() |
static void |
unwind(java.lang.String className,
java.lang.String methodName,
java.lang.String exception) |
public static void initProfiler()
public static void init()
public static void clear()
public static void start()
public static void stop()
public static void setFileName(java.lang.String fileName)
public static void shutdown()
public static java.lang.Iterable<java.lang.Long> threads()
public static java.lang.Iterable<Frame> interactions(long threadId)
public static java.lang.Iterable<Frame> frameList()
public static java.lang.Iterable<ClassAllocation> allocations()
public static long getThreadTotalTime(long threadId)
public static void sortFrameList(java.util.Comparator<Frame> comp)
public static void start(java.lang.String className, java.lang.String methodName)
public static void end(java.lang.String className, java.lang.String method)
public static void beginWait(java.lang.String className, java.lang.String methodName)
public static void endWait(java.lang.String className, java.lang.String methodName)
public static void unwind(java.lang.String className, java.lang.String methodName, java.lang.String exception)
public static void alloc(java.lang.String className)
public void run()
run
in interface java.lang.Runnable