[ 
https://issues.apache.org/activemq/browse/CAMEL-2364?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=61390#action_61390
 ] 

John Ellis commented on CAMEL-2364:
-----------------------------------

EhCache does have its own statistics. Here's a snippet on how to expose them 
via JMX in a Spring application context:
    <bean id="ehCacheManagementService" 
class="net.sf.ehcache.management.ManagementService" init-method="init" 
lazy-init="false">
        <constructor-arg>
            <bean class="net.sf.ehcache.CacheManager" 
factory-method="getInstance"/>
        </constructor-arg>
        <constructor-arg>
            <bean class="org.springframework.jmx.support.JmxUtils" 
factory-method="locateMBeanServer"/>
        </constructor-arg>
        <constructor-arg value="true"/>
        <constructor-arg value="true"/>
        <constructor-arg value="true"/>
        <constructor-arg value="true"/>
    </bean>

Of course you can do the same thing in straight Java:
  ManagementService.registerMBeans(CacheManager.getInstance(), mbeanServer, 
true, true, true, true);

You can get cache hits, misses, in-memory hits, disk hits, size stats this way. 
You can also change CacheConfiguration parameters on the fly.

> Add an ability to display Cache statistics via JMX in camel-cache 
> ------------------------------------------------------------------
>
>                 Key: CAMEL-2364
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2364
>             Project: Apache Camel
>          Issue Type: New Feature
>            Reporter: Ashwin Karpe
>            Priority: Minor
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to