I'm looking into Oracle Coherence for a client, and one of the things they are interested in is getting statistical information back from it to understand usage patterns etc.
I know I can get some information from JMX, however there is also a CacheStatistics interface provided which I'd like to get data from. However I can't see how I should go from having a cache object to getting its statistics.
The code below is my poc implementation, and I can use the 'cache' object to put and get values from the cache, is there a way to link from the cache to the associated statistics? I guess I'm missing something simple somewhere...
NamedCache cache = CacheFactory.getCache(cacheName);
if(cache.isActive()){
//Wrong because there's no link to the cache..
SimpleCacheStatistics scs = new SimpleCacheStatistics();
long hits = scs.getCacheHits();
System.out.println("Cache hits:" +hits+"\n : "+scs.toString());
}