3.17. Instrumentation
OpenJPA provides the ability to instrument various aspects of runtime operation.
Instrumentation involves an instrumentation provider for base instrumentation capabilities and instruments for instrumenting various aspects of OpenJPA.
OpenJPA includes a default instrumentation provider for JMX Platform MBeans.
MBean-based instruments are provided for the data cache, query cache, and query SQL cache.
When enabled, JMX-based remote monitoring tools such as JConsole can be used to monitor various metrics tracked by OpenJPA’s caches by accessing MBeans registered under domain org.apache.openjpa.
Additionally, custom applications can gather metrics by using the JMX API to query OpenJPA’s MBeans.
The openjpa-integration-jmx integration module contains an example of how to access the cache MBeans within program code.