|
JProfiler API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 |
addBookmark(java.lang.String description,
java.awt.Color color,
boolean dashed)
Add a bookmark at the current time. |
static void |
enableTriggerGroup(boolean enabled,
java.lang.String groupId)
Enable or disable all triggers with a specified group ID. |
static void |
enableTriggers(boolean enabled)
Enable or disable all triggers. |
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 |
startCallTracer(int cap,
boolean recordFiltered,
boolean reset)
Starts the call tracer. |
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 |
stopCallTracer()
Stops the call tracer. |
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()
Trigger a heap dump. |
static void |
triggerHeapDump(boolean fullGc,
boolean onlyRecorded,
boolean primitiveData)
Trigger a heap dump. |
static void |
triggerHeapDump(boolean fullGc,
boolean onlyRecorded,
boolean primitiveData,
boolean calculateRetainedSizes)
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 startCallTracer(int cap, boolean recordFiltered, boolean reset)
recordFiltered
- if true, calls into filtered classes will be recorded, too.cap
- the maximum number of events to be recorded. A good default is 100000.reset
- if true previously recorded calls will be cleared..public static void stopCallTracer()
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 addBookmark(java.lang.String description, java.awt.Color color, boolean dashed)
description
- the name of the bookmark, may also be nullcolor
- the color to be used for drawing the bookmark. If null the default color will be used.dashed
- if the line for drwaing the bookmark should be dashed or notpublic static void triggerHeapDump()
triggerHeapDump(boolean, boolean, boolean, boolean)
public static void triggerHeapDump(boolean fullGc, boolean onlyRecorded, boolean primitiveData)
triggerHeapDump(boolean, boolean, boolean, boolean)
public static void triggerHeapDump(boolean fullGc, boolean onlyRecorded, boolean primitiveData, boolean calculateRetainedSizes)
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.calculateRetainedSizes
- if true, the retained sizes of all objects will be calculated. This requires fullGc=true.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.public static void enableTriggerGroup(boolean enabled, java.lang.String groupId) throws java.lang.IllegalArgumentException
enabled
- if the triggers should be enabledgroupId
- the group ID
java.lang.IllegalArgumentException
- if no trigger with the specified group ID existspublic static void enableTriggers(boolean enabled)
enabled
- if the triggers should be enabled
|
JProfiler API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |