是否有任何工具可以监控 Hibernate 二级缓存的使用情况?我知道我可以使用 Hibernate API 来检索此类信息。但是当我有应用程序本身不读取信息并且我不能修改它时,我该怎么办?有没有办法从应用程序外部读取缓存统计信息?
最佳答案
引用 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 viaSessionFactory.getStatistics()
. Hibernate can even be configured to expose these statistics via JMX. Read the Javadoc of the interfaces inorg.hibernate.stats
for more information.
您会找到 org.hibernate.stats
package-summary here .
对于 JMX 部分,请查看 Publishing statistics through JMX .
对于更高级的内容,您必须依赖缓存提供商的特定功能。
关于java - 监控 Hibernate 缓存使用情况的工具,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1839299/