public Map<String, Object> getCacheRuntimeInformationAsJson(Cache cache) { LinkedHashMap<String, Object> json = new LinkedHashMap<>(); StatisticsGateway statistics = cache.getStatistics(); json.put("Get Time in milliseconds", getStatisticsFrom(statistics.cacheGetOperation())); json.put("Put Time in milliseconds", getStatisticsFrom(statistics.cachePutOperation())); json.put("Remove Time in milliseconds", getStatisticsFrom(statistics.cacheRemoveOperation())); json.put("Cache Size", statistics.getSize()); LinkedHashMap<String, Long> cacheCount = new LinkedHashMap<>(); cacheCount.put("Hits", statistics.cacheHitCount()); cacheCount.put("Miss", statistics.cacheMissCount()); cacheCount.put("Expired", statistics.cacheExpiredCount()); cacheCount.put("Eviction", statistics.cacheEvictedCount()); cacheCount.put("Put", statistics.cachePutCount()); cacheCount.put("Remove", statistics.cacheRemoveCount()); json.put("Cache Counts", cacheCount); json.put("Cache Size (Disk)", statistics.getLocalDiskSize()); json.put("Cache Count (Disk)", statistics.localDiskHitCount()); return json; }
/** * {@inheritDoc} */ @Override public long getCacheRemoveRate() { return cache.getStatistics().cacheRemoveOperation().rate().value().longValue(); }
/** * {@inheritDoc} */ @Override public SampledCounter getCacheElementRemovedSample() { return new SampledCounterProxy(cache.getStatistics().cacheRemoveOperation().rate()); }
/** * {@inheritDoc} */ public long getCacheRemoveRate() { long result = 0; for (String cacheName : getCacheNames()) { Ehcache cache = cacheManager.getEhcache(cacheName); if (cache != null) { result += cache.getStatistics().cacheRemoveOperation().rate().value().longValue(); } } return result; }
/** * {@inheritDoc} */ @Override public long getCacheRemoveRate() { return cache.getStatistics().cacheRemoveOperation().rate().value().longValue(); }
/** * {@inheritDoc} */ @Override public long getCacheRemoveRate() { return cache.getStatistics().cacheRemoveOperation().rate().value().longValue(); }
@Override public float getAverageRemoveTime() { final float v = getEhcache().getStatistics().cacheRemoveOperation().latency().average().value().floatValue(); return Float.isNaN(v) ? 0f : v; }
/** * {@inheritDoc} */ @Override public SampledCounter getCacheElementRemovedSample() { return new SampledCounterProxy(cache.getStatistics().cacheRemoveOperation().rate()); }
@Override public float getAverageRemoveTime() { final float v = getEhcache().getStatistics().cacheRemoveOperation().latency().average().value().floatValue(); return Float.isNaN(v) ? 0f : v; }
/** * {@inheritDoc} */ @Override public SampledCounter getCacheElementRemovedSample() { return new SampledCounterProxy(cache.getStatistics().cacheRemoveOperation().rate()); }
/** * {@inheritDoc} */ public long getCacheRemoveRate() { long result = 0; for (String cacheName : getCacheNames()) { Ehcache cache = cacheManager.getEhcache(cacheName); if (cache != null) { result += cache.getStatistics().cacheRemoveOperation().rate().value().longValue(); } } return result; }
/** * {@inheritDoc} */ public long getCacheRemoveRate() { long result = 0; for (String cacheName : getCacheNames()) { Ehcache cache = cacheManager.getEhcache(cacheName); if (cache != null) { result += cache.getStatistics().cacheRemoveOperation().rate().value().longValue(); } } return result; }