|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mule.module.management.mbean.YourKitProfilerService
public class YourKitProfilerService
Field Summary | |
---|---|
protected Log |
logger
logger used by this class |
Fields inherited from interface org.mule.module.management.mbean.YourKitProfilerServiceMBean |
---|
ALLOCATION_RECORDING_ADAPTIVE, ALLOCATION_RECORDING_ALL, CPU_J2EE, CPU_SAMPLING, CPU_TRACING, MONITOR_PROFILING, SNAPSHOT_CAPTURING, SNAPSHOT_HPROF, SNAPSHOT_WITH_HEAP, SNAPSHOT_WITHOUT_HEAP |
Constructor Summary | |
---|---|
YourKitProfilerService()
|
Method Summary | |
---|---|
void |
advanceGeneration(java.lang.String description)
Advance current object generation number. |
java.lang.String |
captureMemorySnapshot()
This method is just a convenient replacement of captureSnapshot(YourKitProfilerServiceMBean.SNAPSHOT_WITH_HEAP) |
java.lang.String |
captureSnapshot(long snapshotFlags)
Captures snapshot: write profiling information to file. |
java.lang.String |
forceGC()
Force GC |
java.lang.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 YourKitProfilerServiceMBean.captureMemorySnapshot() every N
seconds. |
void |
startCPUProfiling(long mode,
java.lang.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 YourKitProfilerServiceMBean.startCapturingMemSnapshot(int) |
void |
stopCPUProfiling()
Stop CPU profiling. |
void |
stopMonitorProfiling()
Stop monitor profiling (requires that the profiled application runs on Java 5 or newer) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected transient Log logger
Constructor Detail |
---|
public YourKitProfilerService() throws java.lang.Exception
java.lang.Exception
Method Detail |
---|
public java.lang.String getHost()
getHost
in interface YourKitProfilerServiceMBean
public int getPort()
getPort
in interface YourKitProfilerServiceMBean
public java.lang.String captureMemorySnapshot() throws java.lang.Exception
captureMemorySnapshot
in interface YourKitProfilerServiceMBean
java.lang.Exception
public java.lang.String captureSnapshot(long snapshotFlags) throws java.lang.Exception
YourKitProfilerServiceMBean.startCPUProfiling(long, String)
, YourKitProfilerServiceMBean.startMonitorProfiling()
or
YourKitProfilerServiceMBean.startAllocationRecording(long)
, or remotely), it won't stop after the
capture. To stop it, explicitly call YourKitProfilerServiceMBean.stopCPUProfiling()
,
YourKitProfilerServiceMBean.stopMonitorProfiling()
or YourKitProfilerServiceMBean.stopAllocationRecording()
.
captureSnapshot
in interface YourKitProfilerServiceMBean
snapshotFlags
- defines how much information should be stored:
java.lang.Exception
- if capture failed. The possible reasons are:
public void startAllocationRecording(long mode) throws java.lang.Exception
startAllocationRecording
in interface YourKitProfilerServiceMBean
mode
- YourKitProfilerServiceMBean.ALLOCATION_RECORDING_ALL or
YourKitProfilerServiceMBean.ALLOCATION_RECORDING_ADAPTIVE
java.lang.Exception
- if capture failed. The possible reasons are:
YourKitProfilerServiceMBean.captureMemorySnapshot()
,
YourKitProfilerServiceMBean.stopCPUProfiling()
public void stopAllocationRecording() throws java.lang.Exception
stopAllocationRecording
in interface YourKitProfilerServiceMBean
java.lang.Exception
- if capture failed. The possible reasons are:
public void startCPUProfiling(long mode, java.lang.String filters) throws java.lang.Exception
startCPUProfiling
in interface YourKitProfilerServiceMBean
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.
java.lang.Exception
- if capture failed. The possible reasons are:
YourKitProfilerServiceMBean.captureSnapshot(long)
,
YourKitProfilerServiceMBean.stopCPUProfiling()
public void stopCPUProfiling() throws java.lang.Exception
stopCPUProfiling
in interface YourKitProfilerServiceMBean
java.lang.Exception
- if capture failed. The possible reasons are:
YourKitProfilerServiceMBean.captureSnapshot(long)
,
YourKitProfilerServiceMBean.startCPUProfiling(long , String)
public void startMonitorProfiling() throws java.lang.Exception
startMonitorProfiling
in interface YourKitProfilerServiceMBean
java.lang.Exception
- if capture failed. The possible reasons are:
YourKitProfilerServiceMBean.stopMonitorProfiling()
,
YourKitProfilerServiceMBean.captureSnapshot(long)
public void stopMonitorProfiling() throws java.lang.Exception
stopMonitorProfiling
in interface YourKitProfilerServiceMBean
java.lang.Exception
- if capture failed. The possible reasons are:
YourKitProfilerServiceMBean.startMonitorProfiling()
,
YourKitProfilerServiceMBean.captureSnapshot(long)
public void advanceGeneration(java.lang.String description) throws java.lang.Exception
advanceGeneration
in interface YourKitProfilerServiceMBean
description
- optional description associated with the generation
java.lang.Exception
- if generation could not be advanced.public java.lang.String forceGC() throws java.lang.Exception
forceGC
in interface YourKitProfilerServiceMBean
java.lang.Exception
public void startCapturingMemSnapshot(int seconds)
YourKitProfilerServiceMBean.captureMemorySnapshot()
every N
seconds.
startCapturingMemSnapshot
in interface YourKitProfilerServiceMBean
seconds
- delay between callsYourKitProfilerServiceMBean.captureMemorySnapshot()
public void stopCapturingMemSnapshot()
YourKitProfilerServiceMBean.startCapturingMemSnapshot(int)
stopCapturingMemSnapshot
in interface YourKitProfilerServiceMBean
public long getStatus() throws java.lang.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");
}
getStatus
in interface YourKitProfilerServiceMBean
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |