public class RemoteController extends java.lang.Object implements RemoteControllerMBean
Controller
class.Constructor and Description |
---|
RemoteController() |
Modifier and Type | Method and Description |
---|---|
void |
addBookmark(java.lang.String description)
Adds a bookmark at the current time.
|
java.lang.String |
convertToAbsolutePath(java.lang.String path)
Return an absolute path for the given path.
|
void |
enableTriggerGroup(boolean enabled,
java.lang.String groupId)
Enable or disable all triggers with a specified group ID.
|
void |
enableTriggers(boolean enabled)
Enable or disable all triggers.
|
void |
markHeap()
Mark all objects currently on the heap as "old".
|
void |
saveSnapshot(java.lang.String file)
Saves a snapshot of all profiling data to disk.
|
void |
saveSnapshotOnExit(java.lang.String file)
Saves a snapshot of all profiling data to disk when the VM shuts down.
|
void |
startAllocRecording(boolean reset)
Starts recording of memory allocations.
|
void |
startComplexityRecording()
Starts algorithmic complexity recording for all previously configured methods.
|
void |
startCPURecording(boolean reset)
Starts recording CPU data.
|
void |
startMethodStatsRecording()
Starts method statistics recording.
|
void |
startMonitorRecording()
Start recording of monitor usage with default thresholds of 100 microseconds
for blocking events and 100 ms for waiting events.
|
void |
startMonitorRecording(int blockedThreshold,
int waitingThreshold)
Start recording of monitor usage.
|
void |
startProbeRecording(java.lang.String probeName,
boolean events,
boolean specialRecording)
Start recording data for a selected probe.
|
void |
startThreadProfiling()
Starts recording of thread states and monitor usage.
|
void |
startVMTelemetryRecording()
Starts recording of VM telemetry data.
|
void |
stopAllocRecording()
Stops recording of memory allocations.
|
void |
stopComplexityRecording()
Stops algorithmic complexity recording and prepares data for snapshot.
|
void |
stopCPURecording()
Stops CPU recording.
|
void |
stopMethodStatsRecording()
Stops method statistics recording.
|
void |
stopMonitorRecording()
Stop recording of monitor usage.
|
void |
stopProbeRecording(java.lang.String probeName)
Stop recording data for a selected probe.
|
void |
stopThreadProfiling()
Stops recording of thread states and monitor usage.
|
void |
stopVMTelemetryRecording()
Stops recording of VM telemetry data.
|
void |
triggerHeapDump()
Triggers a heap dump.
|
void |
triggerHeapDumpWithOptions(boolean fullGc,
boolean selectRecorded,
boolean primitiveData,
boolean calculateRetainedSizes)
Triggers a heap dump.
|
void |
triggerThreadDump()
Trigger a thread dump.
|
public void startCPURecording(boolean reset)
stopCPURecording()
. With these methods you can restrict
CPU profiling to certain regions of your code.startCPURecording
in interface RemoteControllerMBean
reset
- if true
, any previously accumulated CPU profiling
data will be discarded. If false
, CPU data will be accumulated
across pairs of invocations of startCPURecording()
and
stopCPURecording()
.public void stopCPURecording()
startCPURecording()
has been called.
However, you do not have to call it since CPU profiling can run until the
JVM exits.stopCPURecording
in interface RemoteControllerMBean
public void startAllocRecording(boolean reset)
stopAllocRecording()
. With these methods you can restrict
memory allocation profiling to certain regions of your code.
This is especially useful for profiling an application running within
an application server.startAllocRecording
in interface RemoteControllerMBean
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 void stopAllocRecording()
startAllocRecording()
has been called.
However, you do not have to call it since memory profiling can run until the
JVM exits.stopAllocRecording
in interface RemoteControllerMBean
public void addBookmark(java.lang.String description)
addBookmark
in interface RemoteControllerMBean
description
- the name of the bookmark, may also be null
public void triggerHeapDumpWithOptions(boolean fullGc, boolean selectRecorded, boolean primitiveData, boolean calculateRetainedSizes)
saveSnapshot
method, you should call this method from your source code
at an appropriate time.
ATTENTION: Taking a heap dump takes a long time (on the order of seconds). If you call this method to often, your application might become unusable or take an excessively long time to finish.
triggerHeapDumpWithOptions
in interface RemoteControllerMBean
fullGc
- if true
, a full garbage collection will be performed.selectRecorded
- if true
, only objects recorded between startAllocRecording and
stopAllocRecording will be included in the dump.primitiveData
- if true
, primitive data will also be recorded. This has no effect for JVMTI 1.0 (Java 5).calculateRetainedSizes
- if true
, the retained sizes of all objects will be calculated. This requires fullGc=true
.public void triggerHeapDump()
triggerHeapDump
in interface RemoteControllerMBean
RemoteControllerMBean.triggerHeapDumpWithOptions(boolean, boolean, boolean, boolean)
public void markHeap()
RemoteControllerMBean
markHeap
in interface RemoteControllerMBean
public void saveSnapshot(java.lang.String file)
.jps
for the
file
parameter, since JProfiler's GUI frontend filters the corresponding
file choosers for that extension. If you want to save several snapshots during
one profiling run, please take care to provide unique file
parameters
since snapshot files will be overwritten otherwise.
ATTENTION: Saving a snapshot takes a long time (on the order of seconds). If you call this method to often, your application might become unusable or take an excessively long time to finish, and your hard disk might run out of space.
saveSnapshot
in interface RemoteControllerMBean
file
- the file to which the snapshot should be saved.public void startThreadProfiling()
stopThreadProfiling()
. For an offline session, thread
profiling is switched on by default.startThreadProfiling
in interface RemoteControllerMBean
public void stopThreadProfiling()
startThreadProfiling()
. However, you do not have to call it since
thread profiling can run until the JVM exits.stopThreadProfiling
in interface RemoteControllerMBean
public void startVMTelemetryRecording()
stopVMTelemetryRecording()
. For an offline session, VM telemetry
recording is switched on by default.startVMTelemetryRecording
in interface RemoteControllerMBean
public void stopVMTelemetryRecording()
startVMTelemetryRecording()
. However, you do not have to call it since
VM telemetry recording can run until the JVM exits.stopVMTelemetryRecording
in interface RemoteControllerMBean
public void saveSnapshotOnExit(java.lang.String file)
.jps
for the
file
parameter, since JProfiler's GUI frontend filters the corresponding
file choosers for that extension.
ATTENTION: Saving a snapshot can take quite some time (on the order fo seconds). When the VM is shut down during a user logout or a system shutdown, the OS may terminate the VM before saving is completed.
saveSnapshotOnExit
in interface RemoteControllerMBean
file
- the file to which the snapshot should be saved.public void enableTriggerGroup(boolean enabled, java.lang.String groupId) throws java.lang.IllegalArgumentException
enableTriggerGroup
in interface RemoteControllerMBean
enabled
- if the triggers should be enabledgroupId
- the group IDjava.lang.IllegalArgumentException
- if no trigger with the specified group ID existspublic void enableTriggers(boolean enabled)
enableTriggers
in interface RemoteControllerMBean
enabled
- if the triggers should be enabledpublic void startMethodStatsRecording()
stopMethodStatsRecording()
.startMethodStatsRecording
in interface RemoteControllerMBean
public void stopMethodStatsRecording()
stopMethodStatsRecording
in interface RemoteControllerMBean
public void startComplexityRecording()
RemoteControllerMBean
startComplexityRecording
in interface RemoteControllerMBean
public void stopComplexityRecording()
RemoteControllerMBean
stopComplexityRecording
in interface RemoteControllerMBean
public void startMonitorRecording()
stopMonitorRecording()
. Monitor profiling is switched off
by default.startMonitorRecording
in interface RemoteControllerMBean
public void startMonitorRecording(int blockedThreshold, int waitingThreshold)
stopMonitorRecording()
. Monitor profiling is switched off
by default.startMonitorRecording
in interface RemoteControllerMBean
blockedThreshold
- the recording threshold for blocking events in microseconds.waitingThreshold
- the recording threshold for waiting events in microseconds.public void stopMonitorRecording()
startMonitorRecording()
. However, you do not have to call it since
monitor profiling can run until the JVM exits.stopMonitorRecording
in interface RemoteControllerMBean
public void triggerThreadDump()
triggerThreadDump
in interface RemoteControllerMBean
public void startProbeRecording(java.lang.String probeName, boolean events, boolean specialRecording)
startProbeRecording
in interface RemoteControllerMBean
probeName
- the name of the probe. For built-in probes, see the PROBE_NAME
constants in this class.
For custom probes, this name is custom.n
where n is the one-based index of the custom probe.events
- determines whether events should be recorded for the "Events" view of the probe. Has no effect for probes that do not have an "Events" view.specialRecording
- determines whether special recordings for the probe should be switched on. For the "JDBC" probe, this controls connection leak tracking.
Has no effect for other probes without special recording.public void stopProbeRecording(java.lang.String probeName)
stopProbeRecording
in interface RemoteControllerMBean
probeName
- the name of the probe. For built-in probes, see the PROBE_NAME
constants in this class.
For custom probes, this name is custom.n
where n is the one-based index of the custom probe.public java.lang.String convertToAbsolutePath(java.lang.String path)
RemoteControllerMBean.saveSnapshot(String)
method.
The returned path will have file separators of the remote machine.convertToAbsolutePath
in interface RemoteControllerMBean