Is there any tool which would allow for monitoring Hibernate 2nd level cache usage? I know that I could use Hibernate API for retrieving such information. But what should I do when I have application which doesn't read the information itself, and I can't modify it? Is there any way to read cache statistics from the outside of the application?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Quoting Hibernate documentation:
You'll find the
org.hibernate.stats
package-summary here.For the JMX part, have a look at Publishing statistics through JMX.
For more advanced stuff, you'll have to rely on specific features from your cache provider.
If your 2nd level cache is an EhCache, then you can read cache status from its MBean.
See 'JMX Management and Monitoring' in the ehcache documentation: http://ehcache.org/documentation/jmx.html
Implement
http://narcanti.keyboardsamurais.de/hibernate-statistics-jsp-reloaded.html
for "human" use
There is a tool for monitoring hibernate's cache that has been exposed through JMX. Its called hibernate-jconsole and can be downloaded here - http://hibernate-jcons.sourceforge.net/