java-休眠监控解决方案

我想监视休眠状态.
我在互联网上看到zentracker监控器解决方案,该解决方案可以监控许多休眠状态.

但这与休眠3.5的最新版本兼容吗?

如果不是,您是否有解决方案来监视查询执行时间,打开sessionFactory,创建持久对象,…?

预先感谢您的帮助.

最好的祝福,

弗洛朗

附注:我是法国人,对不起我的英语.

解决方法:

I see on the internet the zentracker monitor solution that permit to monitor a lot of activity of hibernate. But It is compatible with the last version of hibernate 3.5.x?

为什么不获取源代码并使用最新版本的Hibernate Core重新编译项目?好吧,我这样做是因为我很好奇并且无法编译,有一些API更改需要一些修改.但是,没有什么复杂的.而且由于该项目似乎不太活跃,所以最好的选择是自己制作.

If it’s not, do you have solution to monitor query execution time, sessionFactory opened, persitence object created, … ?

好吧,正如我说的,您可以使其兼容…

我个人通过JMX收集了Statistics,并使用了自定义工具.从文档中:

07001

Hibernate provides a number of
metrics, from basic information to
more specialized information that is
only relevant in certain scenarios.
All available counters are described
in the Statistics interface API, in
three categories:

  • Metrics related to the general Session usage, such as number of open
    sessions, retrieved JDBC connections,
    etc.
  • Metrics related to the entities, collections, queries, and caches as a
    whole (aka global metrics).
  • Detailed metrics related to a particular entity, collection, query
    or cache region.

For example, you can check the cache
hit, miss, and put ratio of entities,
collections and queries, and the
average time a query needs. Be aware
that the number of milliseconds is
subject to approximation in Java.
Hibernate is tied to the JVM precision
and on some platforms this might only
be accurate to 10 seconds.

看看Performance Monitoring using Hibernate以获取更多灵感.

也可以看看

> Hibernate Profiler:商业工具

相关问题

> Tool for monitoring Hibernate cache usage

参考文献

> Hibernate Core参考指南

> 20.6. Monitoring performance

上一篇:java-跨多个JVM的Jamon统计信息聚合


下一篇:android – 移动设备的真实用户监控