Tool for monitoring Hibernate cache usage

你说的曾经没有我的故事 提交于 2019-12-03 21:07:14

Quoting Hibernate documentation:

3.4.6. Hibernate statistics

If you enable hibernate.generate_statistics, Hibernate exposes a number of metrics that are useful when tuning a running system via SessionFactory.getStatistics(). Hibernate can even be configured to expose these statistics via JMX. Read the Javadoc of the interfaces in org.hibernate.stats for more information.

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

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/

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