public interface JvmCpuMonitorMXBean extends PlatformManagedObject
This interface provides APIs to obtain JVM CPU usage information in terms of thread categories. APIs are also available to get and set the thread category.
JvmCpuMonitorMXBean
...
try {
mxbeanName = new ObjectName("com.ibm.lang.management:type=JvmCpuMonitor");
} catch (MalformedObjectNameException e) {
// Exception Handling
}
try {
MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer();
if (true != mbeanServer.isRegistered(mxbeanName)) {
// JvmCpuMonitorMXBean not registered
}
JvmCpuMonitorMXBean jcmBean = JMX.newMXBeanProxy(mbeanServer, mxbeanName, JvmCpuMonitorMXBean.class);
} catch (Exception e) {
// Exception Handling
}
Modifier and Type | Method and Description |
---|---|
String |
getThreadCategory(long id)
This function gets the current value of the thread category for the target thread.
|
JvmCpuMonitorInfo |
getThreadsCpuUsage()
This function creates a new
JvmCpuMonitorInfo object and populates it
with CPU usage statistics of the various thread categories. |
JvmCpuMonitorInfo |
getThreadsCpuUsage(JvmCpuMonitorInfo jcmInfo)
This function updates the user provided
JvmCpuMonitorInfo object
with CPU usage statistics of the various thread categories. |
int |
setThreadCategory(long id,
String category)
This function sets the thread category of the target thread.
|
getObjectName
JvmCpuMonitorInfo getThreadsCpuUsage(JvmCpuMonitorInfo jcmInfo) throws NullPointerException, UnsupportedOperationException
JvmCpuMonitorInfo
object
with CPU usage statistics of the various thread categories.
The statistics are an aggregate across all CPUs of the operating system.jcmInfo
- User provided JvmCpuMonitorInfo object.NullPointerException
- if a null reference is passed.UnsupportedOperationException
- if CPU monitoring is disabled.JvmCpuMonitorInfo getThreadsCpuUsage() throws UnsupportedOperationException
JvmCpuMonitorInfo
object and populates it
with CPU usage statistics of the various thread categories.
The statistics are an aggregate across all CPUs of the operating system.JvmCpuMonitorInfo
instance.UnsupportedOperationException
- if CPU monitoring is disabled.int setThreadCategory(long id, String category) throws IllegalArgumentException
id
- The target thread id for which the type needs to be set.category
- The category of the target thread.IllegalArgumentException
- if a value is passed for the thread category or thread id that is not valid.String getThreadCategory(long id) throws IllegalArgumentException
id
- The target thread id for which we need the thread category.IllegalArgumentException
- if the thread id is not valid.Eclipse OpenJ9 website.
To raise a bug report or suggest an improvement create an Eclipse OpenJ9 issue.
Copyright © 2001, 2024 IBM Corp. and others.