How to create performance counters that are exposed by jmx and accessed via jconsole?
Say whenever I instantiate a particular object, I increment a counter. I want to expose the counter value so I can view the value in jconsole.
How would I go about doing this?
There’s a few steps:
ManagementFactory.getPlatformMBeanServer().registerMBean(...)There are details in the JMX tutorial.