Hibernate Search(基于version3.4)--第八章Monitoring

Monitoring

 

Hibernate Search通过SearchFactory.getStatistics()提供了到Statistics对象的访问。通过Statistics对象,你可以得到一些有用的信息,如:哪些类被索引了或index中有多少个实体类。然而,通过指定hibernate.search.generate_statistics属性,你还可以收集Lucene query的总数或平均数,对象加载时间等。

 

 

8.1. JMX

你也可以通过JMX访问statistics。设置属性hibernate.search.jmx_enabled,便会自动地注册StatisticsInfoMBean。依赖于你的配置,IndexControlMBean和IndexingProgressMonitorMBean会同样被注册。让我们更近距离地看看不同的MBeans。

 

Tip:如果你想通过JConsole远程地访问你的JMX beans,请确保设置system属性 com.sun.management.jmxremote为true。

 

 

8.1.1. StatisticsInfoMBean

 

该MBean使你能访问在之前章节介绍的Statistics对象。

 

8.1.2. IndexControlMBean

该MBean允许去建立,优化和purge某个实体的index。Indexing通过maxx indexing API触发(seeSection 6.3.2, “Using a MassIndexer”)。该bean注册到JMX有一个要求,就是Hibernate的SessionFactory要通过hibernate.session_factory_name属性绑定到JNDI。 IndexControlMBean及其API还在测试阶段。

 

8.1.3. IndexingProgressMonitorMBean

This MBean is an implementation MassIndexerProgressMonitor interface. If hibernate.search.jmx_enabled is enabled and the mass indexer API is used the indexing progress can be followed via this bean. The bean will only be bound to JMX while indexing is in progress. Once indexing is completed the MBean is not longer available.

转载于:https://www.cnblogs.com/faylz/archive/2013/04/30/3051962.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值