public interface YourKitProfilerServiceMBean
| Modifier and Type | Field and Description |
|---|---|
static long |
ALLOCATION_RECORDING_ADAPTIVE |
static long |
ALLOCATION_RECORDING_ALL |
static long |
CPU_J2EE |
static long |
CPU_SAMPLING |
static long |
CPU_TRACING |
static long |
MONITOR_PROFILING |
static long |
SNAPSHOT_CAPTURING
this mark is added to getStatus to indicate that captureEverySec was stated
|
static long |
SNAPSHOT_HPROF |
static long |
SNAPSHOT_WITH_HEAP |
static long |
SNAPSHOT_WITHOUT_HEAP |
| Modifier and Type | Method and Description |
|---|---|
void |
advanceGeneration(String description)
Advance current object generation number.
|
String |
captureMemorySnapshot()
This method is just a convenient replacement of
captureSnapshot(YourKitProfilerServiceMBean.SNAPSHOT_WITH_HEAP)
|
String |
captureSnapshot(long snapshotFlags)
Captures snapshot: write profiling information to file.
|
String |
forceGC()
Force GC
|
String |
getHost() |
int |
getPort() |
long |
getStatus()
Get current profiling status.
|
void |
startAllocationRecording(long mode)
Start object allocation recording.
|
void |
startCapturingMemSnapshot(int seconds)
Starts new daemon thread which calls
captureMemorySnapshot() every N
seconds. |
void |
startCPUProfiling(long mode,
String filters)
Start CPU profiling.
|
void |
startMonitorProfiling()
Start monitor profiling (requires that the profiled application runs on Java 5
or newer)
|
void |
stopAllocationRecording() |
void |
stopCapturingMemSnapshot()
Stops daemon thread started by
startCapturingMemSnapshot(int) |
void |
stopCPUProfiling()
Stop CPU profiling.
|
void |
stopMonitorProfiling()
Stop monitor profiling (requires that the profiled application runs on Java 5
or newer)
|
static final long ALLOCATION_RECORDING_ALL
static final long ALLOCATION_RECORDING_ADAPTIVE
static final long CPU_SAMPLING
static final long CPU_TRACING
static final long MONITOR_PROFILING
static final long CPU_J2EE
static final long SNAPSHOT_WITHOUT_HEAP
static final long SNAPSHOT_WITH_HEAP
static final long SNAPSHOT_HPROF
static final long SNAPSHOT_CAPTURING
String getHost()
int getPort()
String captureMemorySnapshot() throws Exception
ExceptionString captureSnapshot(long snapshotFlags) throws Exception
startCPUProfiling(long, String), startMonitorProfiling() or
startAllocationRecording(long), or remotely), it won't stop after the
capture. To stop it, explicitly call stopCPUProfiling(),
stopMonitorProfiling() or stopAllocationRecording().snapshotFlags - defines how much information should be stored:
Exception - if capture failed. The possible reasons are:
void advanceGeneration(String description) throws Exception
description - optional description associated with the generationException - if generation could not be advanced.void startAllocationRecording(long mode)
throws Exception
mode - YourKitProfilerServiceMBean.ALLOCATION_RECORDING_ALL or
YourKitProfilerServiceMBean.ALLOCATION_RECORDING_ADAPTIVEException - if capture failed. The possible reasons are:
captureMemorySnapshot(),
stopCPUProfiling()void stopAllocationRecording()
throws Exception
Exception - if capture failed. The possible reasons are:
void startCPUProfiling(long mode,
String filters)
throws Exception
mode - YourKitProfilerServiceMBean.CPU_SAMPLING or
YourKitProfilerServiceMBean.CPU_TRACING or
YourKitProfilerServiceMBean.CPU_SAMPLING |
YourKitProfilerServiceMBean.CPU_J2EE or
YourKitProfilerServiceMBean.CPU_TRACING |
YourKitProfilerServiceMBean.CPU_J2EEfilters - string containing '\n'-separated list of classes whose methods
should not be profiled. Wildcards are accepted ('*'). More methods
are profiled, bigger the overhead. The filters are used with
YourKitProfilerServiceMBean.CPU_TRACING only; with
YourKitProfilerServiceMBean.CPU_SAMPLING the value is ignored. If
null or empty string passed, all methods will be profiled (not
recommended due to high overhead). For example, you can pass
DEFAULT_FILTERS.Exception - if capture failed. The possible reasons are:
captureSnapshot(long),
stopCPUProfiling()void stopCPUProfiling()
throws Exception
Exception - if capture failed. The possible reasons are:
captureSnapshot(long),
startCPUProfiling(long , String)String forceGC() throws Exception
Exceptionvoid startMonitorProfiling()
throws Exception
Exception - if capture failed. The possible reasons are:
stopMonitorProfiling(),
captureSnapshot(long)void stopMonitorProfiling()
throws Exception
Exception - if capture failed. The possible reasons are:
startMonitorProfiling(),
captureSnapshot(long)void startCapturingMemSnapshot(int seconds)
captureMemorySnapshot() every N
seconds.seconds - delay between callscaptureMemorySnapshot()void stopCapturingMemSnapshot()
startCapturingMemSnapshot(int)long getStatus()
throws Exception
long status = controller.getStatus();
if ((status & YourKitProfilerServiceMBean.ALLOCATION_RECORDING_ADAPTIVE) != 0) {
System.out.println("Allocation recording is on (adaptive)");
}
else if ((status & YourKitProfilerServiceMBean.ALLOCATION_RECORDING_ALL) != 0) {
System.out.println("Allocation recording is on (all objects)");
}
else {
System.out.println("Allocation recording is off");
}
if ((status & YourKitProfilerServiceMBean.CPU_TRACING) != 0) {
System.out.println("CPU profiling is on (tracing)");
}
else if ((status & YourKitProfilerServiceMBean.CPU_SAMPLING) != 0) {
System.out.println("CPU profiling is on (sampling)");
}
else {
System.out.println("CPU profiling is off");
}
if ((status & YourKitProfilerServiceMBean.MONITOR_PROFILING) != 0) {
System.out.println("Monitor profiling is on");
}
else {
System.out.println("Monitor profiling is off");
}
if ((status & YourKitProfilerServiceMBean.SNAPSHOT_CAPTURING) != 0) {
System.out.println("Snaphot capturing is on");
}
else {
System.out.println("Snaphot capturing is off");
}
ExceptionCopyright © 2003–2021 MuleSoft, Inc.. All rights reserved.