[英]Tomcat JMX CPU Usage Percentage
I want to find out CPU usage ( in Percentage ) of an Apache Tomcat Server( 6.x ) using JMX . 我想找出使用JMX的Apache Tomcat服务器( 6.x )的CPU使用率( 百分比 )。
There is an attribute ProcessCpuTime
of MBean java.lang:OperatingSystem
. MBean java.lang:OperatingSystem
有一个属性ProcessCpuTime
。 But, how to calculate usage percentage from it? 但是,如何从中计算使用百分比?
Thanks. 谢谢。
Take the difference of two samples and divide by the time between samples. 取两个样本的差异并除以样本之间的时间。
To get a percentage, multiply by 100. 要获得百分比,请乘以100。
由于您可能希望随着时间的推移这样做,您可以使用http://jmxtrans.googlecode.com/等工具通过JMX查询Tomcat,然后使用Graphite进行图形化。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.