Bug 1400636 - JCache statistics doesn't work over JMX
Summary: JCache statistics doesn't work over JMX
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Candlepin
Classification: Community
Component: candlepin
Version: 2.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: candlepin-bugs
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-01 16:52 UTC by Filip Nguyen
Modified: 2017-08-01 18:49 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 18:49:51 UTC


Attachments (Terms of Use)

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:


Note You need to log in before you can comment on or make changes to this bug.