I have some JMX Beans that expose performance information in my application. I would like to have some facility to plot an attribute of an MBean in a graph for monitoring (a la Windows Perf Mon). I love the stuff that comes with JConsole and VisualVM, but I have not been able to find a nice plugin that will let me select an attribute on an MBean and monitor it. Anyone have any ideas?
5 Answers
You can plot JMX numeric values in VisualVM, double-clicking on numeric attribute values will display a chart that plots changes in that numeric value.
For example, double-clicking on the CollectionTime attribute of the Garbage Collector MBean MarksweepCompact will plot the time spent performing garbage collection.
You can try JRockit Mission Control. It allows you to customize the user interface with your own graphs, tables and even dials for the MBean attributes you want to monitor.
The customized ui is stored in a workspace directory, by default in your home directory, but you can have several workspaces and start up Mission Control with the one you want to use.
jrcm.exe -data c:/application1
jrcm.exe -data c:/application2
Polling the JMX variables is relatively straightforward. The presentation is perhaps more of a pain.
For the charting component, you may want to check out JFreeChart. Although it's not a real-time charting package, it's actually quite performant for these type of applications. Check out some samples here.
JRDS will do what you want. It is a bit tricky to setup, but once you figure out the configuration, you can have it create graphs for your JMX attributes. It uses RRD4j (like rrd but in java) under the covers so it can keep "rolled up" historical data for you as well.