Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-1884

Expose JMX statistics from Hibernate Search

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      it is possible to add jmx hook to obtain Hibernate Search SearchFactory Statistics by using this property :
      <indexing enabled="true" indexLocalOnly="true">
      <properties>
      <property name="hibernate.search.jmx_enabled" value="true" />
      </properties>
      </indexing>

      tough this property does not allow multiple registration (one registration per cache).
      it would be nice to wrap the Statistics object from HibernateSearch into the actual cache object mbean.

      i guess the implementation could look like this :
      // get search factory statistics
      org.hibernate.search.stat.Statistics statistics = Search.getSearchManager(org.infinispan.Cache).getSearchFactory().getStatistics();
      // wrap search factory statistics
      SearchFactoryStatisticMBean mbean = new SearchFactoryStatisticMBeanImpl(statistics);
      // expose mbean
      ManagementFactory.getPlatformMBeanServer().registerMBean(new ObjectName("..."), mbean);

              rh-ee-galder Galder ZamarreƱo
              mathieu@mathieulachance.com Mathieu Lachance (Inactive)
              Archiver:
              rhn-support-adongare Amol Dongare

                Created:
                Updated:
                Resolved:
                Archived: