Bug 1400636

Summary: JCache statistics doesn't work over JMX
Product: [Community] Candlepin Reporter: Filip Nguyen <fnguyen>
Component: candlepinAssignee: candlepin-bugs
Status: CLOSED WONTFIX QA Contact: Katello QA List <katello-qa-list>
Severity: low Docs Contact:
Priority: medium    
Version: 2.0CC: csnyder, mstead, redakkan, skallesh
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 18:49:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Filip Nguyen 2016-12-01 16:52:54 UTC
Description of problem:
Its not possible to see cache statistics of configured JCache caches through JMX. Initially I thought its due to missing statistics="true" attribute in ehcache.xml. But it isn't the case.

It seems that when using cache directly via CacheManager.getInstance().getCache, the statistics are published via JMX. However, when using caches through JCache interface, the statistics are not published via JMX.

Nontheless they are collected. This can be proved by the following code snippet

        net.sf.ehcache.Cache unwrapped = (net.sf.ehcache.Cache) c.unwrap(net.sf.ehcache.Cache.class);
        long size = unwrapped.getStatistics().getLocalHeapSize();



Version-Release number of selected component (if applicable):


How reproducible:
Always


Steps to Reproduce:
1. Deploy Candlepin with config:
cache.jmx.statistics=true

2. Run buildr rspec:owner_resource_spec
3. Check JConsole statistics

Actual results:
All the statistics are 0

Expected results:
Statistics show non-zero values

Additional info: