监控Hibernate缓存使用情况的工具 [英] Tool for monitoring Hibernate cache usage
问题描述
是否有任何工具可以监视Hibernate二级缓存的使用情况?我知道我可以使用Hibernate API来检索这些信息。但是,如果我的应用程序没有读取信息本身,我不能修改它,我该怎么办?有什么办法从应用程序的外部读取缓存统计信息吗?
引用Hibernate documentation :
$ b
Hibernate statistics
如果启用
hibernate.generate_statistics
,
Hibernate会公开一些指标
,通过
SessionFactory.getStatistics()
调整正在运行的
系统时非常有用。
Hibernate甚至可以配置为
通过JMX公开这些统计数据。阅读
org.hibernate.stats
中的接口的Javadoc以获得更多
信息。
您会发现 org.hibernate.stats
package-summary 这里。
对于JMX部分,请查看通过JMX发布统计信息。
对于更高级的内容,您必须依赖缓存提供者的特定功能。
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?
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 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.
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.
这篇关于监控Hibernate缓存使用情况的工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!