Java app performance counters viewed in Perfmon

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 18:07:25

Since you tagged this with JMX and MBeans, I assume your counters are accessible from a Java MBean. If so you could use jconsole, provided with the Java SDK, to monitor the counters. Once you find your MBean in the MBeans tab, double click on the value and it will draw a nice line graph for easy monitoring.

See JConsole Guide for more info.

BenM

The following tutorial might be of use: http://www.developer.com/java/ent/article.php/3087741/Hooking-to-PerfMon-from-Java.htm

It shows how a Java application defines a custom counter that can be monitored in Perfmon. It basically boils down to using an extension DLL to the performance monitor and communicating with that via a memory mapped file. You could then hook your JMX counters into a similar mechanism so that they can be monitored from Perfmon.

This seems to be exactly what you're looking for, but it's not free: http://www.adventnet.com/products/snmpadaptor/faqs/general.html

If you want to do this programatically, you can create a JMXConnection to the machine, then accessing the MBeans from there. We did this ourselves for a function test that involved keeping track of the number of threads in the application, which there's a counter for that you can access through JMX. If you want nice graphs and things like that I suggest using JConsole, as mentioned above. There's also a program called JProfiler that works like JConsole on steroids, basically. There's a free trial so you can try it out.

This article outlines how to access Windows PerfMon stats from Java and expose them as MBean attributes through JMX.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!