java.lang.Objectcom.jprofiler.api.agent.Controller
public class Controller
This is JProfiler's profiling API. It is contained in bin/agent.jar in your JProfiler installation directory. Call these static methods from your source code to influence the run time behaviour of JProfiler.
When executing your application without JProfiler, all calls into this class will quietly do nothing.
Nested Class Summary | |
---|---|
static interface |
Controller.HTTPRequestResolver
Interface for mapping HTTP requests to strings that are displayed in the JProfiler GUI. |
static interface |
Controller.JMSResolver
Interface for mapping JMS messages to strings that are displayed in the JProfiler GUI. |
Method Summary | |
---|---|
static void |
addBookmark(java.lang.String description)
Adds a bookmark at the current time. |
static void |
registerHTTPRequestResolver(Controller.HTTPRequestResolver resolver)
Registers a resolver class that will map HTTP requests to description strings. |
static void |
registerJMSResolver(Controller.JMSResolver resolver)
Registers a resolver class that will map JMS messages to description strings. |
static void |
saveSnapshot(java.io.File file)
Saves a snapshot of all profiling data to disk. |
static void |
saveSnapshotOnExit(java.io.File file)
Saves a snapshot of all profiling data to disk when the VM shuts down. |
static void |
startAllocRecording(boolean reset)
Starts recording of memory allocations. |
static void |
startCPURecording(boolean reset)
Starts recording CPU data. |
static void |
startThreadProfiling()
Starts recording of thread states and monitor usage. |
static void |
startVMTelemetryRecording()
Starts recording of VM telemetry data. |
static void |
stopAllocRecording()
Stops recording of memory allocations. |
static void |
stopCPURecording()
Stops CPU recording. |
static void |
stopThreadProfiling()
Stops recording of thread states and monitor usage. |
static void |
stopVMTelemetryRecording()
Stops recording of VM telemetry data. |
static void |
triggerHeapDump(boolean fullGc,
boolean onlyRecorded,
boolean primitiveData)
Triggers a heap dump. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void startCPURecording(boolean reset)
reset
- if true, any previously accumulated CPU profiling
data will be discarded. If false, CPU data will be accumulated
accross pairs of invocations of startCPURecording() and
stopCPURecording().public static void stopCPURecording()
public static void startAllocRecording(boolean reset)
reset
- if true, any previously recorded profiling
data will be discarded. If false, allocations within all
pairs of invocations of startAllocRecording() and
stopAllocRecording() will be recorded.public static void stopAllocRecording()
public static void addBookmark(java.lang.String description)
description
- the name of the bookmark, may also be nullpublic static void triggerHeapDump(boolean fullGc, boolean onlyRecorded, boolean primitiveData)
fullGc
- if true, a full garbage collection will be performed.onlyRecorded
- if true, only objects recorded between startAllocRecording and
stopAllocRecording will be inlucded in the dump.primitiveData
- if true, also primitive data will be recorded in JVMPI mode.public static void saveSnapshot(java.io.File file)
file
- the file to which the snapshot should be saved.public static void registerJMSResolver(Controller.JMSResolver resolver)
resolver
- the resolver, null to restore the default behavior.public static void registerHTTPRequestResolver(Controller.HTTPRequestResolver resolver)
resolver
- the resolver, null to restore the default behavior.public static void startThreadProfiling()
public static void stopThreadProfiling()
public static void startVMTelemetryRecording()
public static void stopVMTelemetryRecording()
public static void saveSnapshotOnExit(java.io.File file)
file
- the file to which the snapshot should be saved.