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; }
/** * Number of times a requested item was found in the Disk Store. * * @return the number of times a requested item was found on Disk, or 0 if there is no disk storage configured. */ public long getOnDiskHits() { return statistics.localDiskHitCount(); }
/** * {@inheritDoc} */ public double getOnDiskHitPercentage() { long hits = statistics.localDiskHitCount(); long misses = statistics.localDiskMissCount(); long total = hits + misses; return getPercentage(hits, total); }
/** * {@inheritDoc} */ @Override public long getOnDiskHitCount() { try { return cache.getStatistics().localDiskHitCount(); } catch (RuntimeException e) { throw Utils.newPlainException(e); } }
/** * Number of times a requested item was found in the Disk Store. * * @return the number of times a requested item was found on Disk, or 0 if there is no disk storage configured. */ public long getOnDiskHits() { return statistics.localDiskHitCount(); }
/** * Number of times a requested item was found in the Disk Store. * * @return the number of times a requested item was found on Disk, or 0 if there is no disk storage configured. */ public long getOnDiskHits() { return statistics.localDiskHitCount(); }
/** * {@inheritDoc} */ public double getOnDiskHitPercentage() { long hits = statistics.localDiskHitCount(); long misses = statistics.localDiskMissCount(); long total = hits + misses; return getPercentage(hits, total); }
/** * {@inheritDoc} */ @Override public long getOnDiskHitCount() { try { return cache.getStatistics().localDiskHitCount(); } catch (RuntimeException e) { throw Utils.newPlainException(e); } }
/** * {@inheritDoc} */ public double getOnDiskHitPercentage() { long hits = statistics.localDiskHitCount(); long misses = statistics.localDiskMissCount(); long total = hits + misses; return getPercentage(hits, total); }
/** * {@inheritDoc} */ @Override public long getOnDiskHitCount() { try { return cache.getStatistics().localDiskHitCount(); } catch (RuntimeException e) { throw Utils.newPlainException(e); } }
cacheStats.put("LocalHeapHitCount", statisticsGateway.localHeapHitCount()); cacheStats.put("LocalHeapMissCount", statisticsGateway.localHeapMissCount()); cacheStats.put("LocalDiskHitCount", statisticsGateway.localDiskHitCount()); cacheStats.put("LocalDiskMissCount", statisticsGateway.localDiskMissCount());
(Gauge<Long>) () -> cache.getStatistics().localDiskHitCount());