public Map<String, long[]> getCacheMetrics() {
Map<String, long[]> result = new HashMap<String, long[]>();
for (String cacheName : getCacheNames()) {
Ehcache cache = cacheManager.getEhcache(cacheName);
if (cache != null) {
SampledCacheStatistics stats = cache.getSampledCacheStatistics();
result.put(cacheName, new long[] {stats.getCacheHitMostRecentSample(),
stats.getCacheMissNotFoundMostRecentSample()
+ stats.getCacheMissExpiredMostRecentSample(),
stats.getCacheElementPutMostRecentSample(), });
}
}
return result;
}