Package org.jppf.management.diagnostics
Interface DiagnosticsMBean
- All Known Implementing Classes:
Diagnostics
public interface DiagnosticsMBean
Interface for the diagnostics MBean.
- Author:
- Laurent Cohen
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioncpuLoad()Get an approximation of the current CPU load.voidgc()Perform a full garbage collection.List<JPPFProperty<?>>Get the list of properties available as monitoring data.Determine whether a deadlock is detected in the JVM.Get a summarized snapshot of the JVM health.Get a a string representation of a JVM health snapshot.heapDump()Trigger a heap dump of the JVM.Get the current state of the heap and non-heap memory for the JVM.Get a full thread dump, including detection of deadlocks.String[]Get the names of all live threads in the current JVM.
-
Field Details
-
MBEAN_NAME_DRIVER
The name of this MBean in a driver.- See Also:
-
MBEAN_NAME_NODE
The name of this MBean in a node.- See Also:
-
-
Method Details
-
memoryInformation
Get the current state of the heap and non-heap memory for the JVM.- Returns:
- a
MemoryInformationinstance. - Throws:
Exception- if any error occurs.
-
threadNames
Get the names of all live threads in the current JVM.- Returns:
- an arrray of thread names as strings.
- Throws:
Exception- if any error occurs.
-
gc
Perform a full garbage collection. This method callsSystem.gc().- Throws:
Exception- if any error occurs.
-
threadDump
Get a full thread dump, including detection of deadlocks.- Returns:
- a
ThreadDumpinstance. - Throws:
Exception- if any error occurs.
-
hasDeadlock
Determine whether a deadlock is detected in the JVM.- Returns:
trueif a deadlock is detected,falseotherwise.- Throws:
Exception- if any error occurs.
-
healthSnapshot
Get a summarized snapshot of the JVM health.- Returns:
- a
HealthSnapshotinstance. - Throws:
Exception- if any error occurs.
-
healthSnapshotAsString
Get a a string representation of a JVM health snapshot. The returned string contains a set of key / value pairs separated by new lines. As such, it can be loaded directly into aPropertiesorTypedPropertiesobject via theirload(Reader)method, using aStringReader.- Returns:
- a
Properties-compatible string representation of a JVM health snapshot. - Throws:
Exception- if any error occurs.
-
heapDump
Trigger a heap dump of the JVM. This will not work with all JVM implementations. It should work with Oracle standard and JRockit JVMs, along with IBM JVM.- Returns:
- a message describing the outcome.
- Throws:
Exception- if any error occurs.
-
cpuLoad
Double cpuLoad()Get an approximation of the current CPU load. The computed value is equal tosumi(thread_used_cpui) / interval, for all the live threads of the JVM at the time of the computation. Thus, errors may occur, since many threads may have been created then died between two computations. However, in most cases this is a reasonable approximation, whose computation does not tax the CPU too heavily.- Returns:
- the cpu load as a double value in the range
[0, 1](ratio oftotalCpuTime / computationInterval), or -1d if CPU time measurement is not available for the JVM.
-
getMonitoringDataProperties
List<JPPFProperty<?>> getMonitoringDataProperties()Get the list of properties available as monitoring data.- Returns:
- a list of the properties described as instances of
JPPFProperty.
-