ThreadMXBean Platform MBean: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 17: | Line 17: | ||
java.lang:type=Threading | java.lang:type=Threading | ||
</PRE> | </PRE> | ||
=API= | |||
<syntaxhighlight lang='java'> | |||
MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer(); | |||
Object result = mBeanServer.getAttribute(new ObjectName("java.lang:type=Threading"), "ThreadCount"); | |||
</syntaxhighlight> | |||
=Metrics= | =Metrics= |
Latest revision as of 17:59, 24 July 2017
External
Internal
Overview
Represents the management interface for the thread system of the Java virtual machine.
JMX clients can look it up using its ObjectName:
java.lang:type=Threading
API
MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
Object result = mBeanServer.getAttribute(new ObjectName("java.lang:type=Threading"), "ThreadCount");
Metrics
ThreadCount
The current number of live threads including both daemon and non-daemon threads.