private LinkedHashMap<String, Object> getStatisticsFrom(ExtendedStatistics.Result result) { LinkedHashMap<String, Object> time = new LinkedHashMap<>(); time.put("Average", String.valueOf(result.latency().average().value())); time.put("Minimum", String.valueOf(result.latency().minimum().value())); time.put("Maximum", String.valueOf(result.latency().maximum().value())); return time; }
/** * {@inheritDoc} */ public long getMaxGetTimeMillis() { long rv = 0; for (String cacheName : cacheManager.getCacheNames()) { Cache cache = cacheManager.getCache(cacheName); if (cache != null) { rv = Math.max(rv, TimeUnit.MILLISECONDS.convert(cache.getStatistics().cacheSearchOperation().latency().maximum().value().longValue(), TimeUnit.NANOSECONDS)); } } return rv; }
/** * {@inheritDoc} * * @see net.sf.ehcache.hibernate.management.api.EhcacheStats#getMaxGetTimeMillis(java.lang.String) */ public long getMaxGetTimeMillis(String cacheName) { Cache cache = cacheManager.getCache(cacheName); if (cache != null) { return TimeUnit.MILLISECONDS.convert(cache.getStatistics().cacheGetOperation().latency().maximum().value().longValue(), TimeUnit.NANOSECONDS); } else { return 0; } }
/** * {@inheritDoc} */ @Override public long getAverageSearchTime() { return cache.getStatistics().cacheSearchOperation().latency().average().value().longValue(); }
/** * {@inheritDoc} */ @Override public Long getMinGetTimeNanos() { try { return (Long)cache.getStatistics().cacheGetOperation().latency().minimum().value(); } catch (RuntimeException e) { throw Utils.newPlainException(e); } }
/** * {@inheritDoc} */ public long getMinGetTimeMillis() { long rv = 0; for (String cacheName : cacheManager.getCacheNames()) { Cache cache = cacheManager.getCache(cacheName); if (cache != null) { rv = Math.max(rv, TimeUnit.MILLISECONDS.convert(cache.getStatistics().cacheSearchOperation().latency().minimum().value().longValue(), TimeUnit.NANOSECONDS)); // TODO CRSS why max? } } return rv; }
/** * {@inheritDoc} */ public float getCacheAverageGetTime() { float result = 0; int instances = 0; for (String cacheName : getCacheNames()) { Ehcache cache = cacheManager.getEhcache(cacheName); if (cache != null) { result += cache.getStatistics().cacheSearchOperation().latency().average().value().longValue(); instances++; } } return instances > 0 ? result / instances : 0; }
/** * {@inheritDoc} * * @see net.sf.ehcache.hibernate.management.api.EhcacheStats#getMinGetTimeMillis(java.lang.String) */ public long getMinGetTimeMillis(String cacheName) { Cache cache = cacheManager.getCache(cacheName); if (cache != null) { return TimeUnit.MILLISECONDS.convert(cache.getStatistics().cacheGetOperation().latency().minimum().value().longValue(), TimeUnit.NANOSECONDS); } else { return 0; } }
/** * {@inheritDoc} * * @see net.sf.ehcache.hibernate.management.api.EhcacheStats#getAverageGetTimeMillis(java.lang.String) */ public float getAverageGetTimeMillis(String region) { Cache cache = this.cacheManager.getCache(region); if (cache != null) { return TimeUnit.MILLISECONDS.convert(cache.getStatistics().cacheGetOperation().latency().average().value().longValue(), TimeUnit.NANOSECONDS); } else { return -1f; } }
/** * {@inheritDoc} */ public long getCacheAverageSearchTime() { long result = 0; for (String cacheName : getCacheNames()) { Ehcache cache = cacheManager.getEhcache(cacheName); if (cache != null) { result += cache.getStatistics().cacheSearchOperation().latency().average().value().longValue(); } } return result; }
@Override public long getAverageGetTimeNanos() { return cache.getStatistics().cacheGetOperation().latency().average().value().longValue(); }
/** * {@inheritDoc} */ @Override public long getAverageSearchTime() { return cache.getStatistics().cacheSearchOperation().latency().average().value().longValue(); }
/** * {@inheritDoc} */ @Override public Long getMinGetTimeNanos() { try { return (Long)cache.getStatistics().cacheGetOperation().latency().minimum().value(); } catch (RuntimeException e) { throw Utils.newPlainException(e); } }
/** * {@inheritDoc} */ @Override public SampledRateCounter getAverageGetTimeSample() { return new SampledRateCounterProxy(cache.getStatistics().cacheGetOperation().latency().average()); }
/** * {@inheritDoc} */ @Override public long getAverageGetTime() { try { return cache.getStatistics().cacheGetOperation().latency().average().value().longValue(); } catch (RuntimeException e) { throw Utils.newPlainException(e); } }
/** * {@inheritDoc} */ @Override public SampledRateCounter getAverageSearchTimeSample() { return new SampledRateCounterProxy(cache.getStatistics().cacheSearchOperation().latency().average()); }
/** * {@inheritDoc} */ @Override public Long getMaxGetTimeNanos() { try { return (Long)cache.getStatistics().cacheGetOperation().latency().maximum().value(); } catch (RuntimeException e) { throw Utils.newPlainException(e); } }
private void recordResult(List<AttributeProxy> proxies, final Result result, String longerName) { recordLongStatistic(proxies, longerName + ".count", "Statistic Counter", result.count()); recordDoubleStatistic(proxies, longerName + ".rate", "Statistic Rate", result.rate()); recordLongStatistic(proxies, longerName + ".latencyMin", "Statistic Latency Minimum", result.latency().minimum()); recordLongStatistic(proxies, longerName + ".latencyMax", "Statistic Latency Maximum", result.latency().maximum()); recordDoubleStatistic(proxies, longerName + ".latencyAvg", "Statistic Latency Average", result.latency().average()); }
@Override public Double getValue() { return cache.getStatistics().cacheSearchOperation().latency().average().value(); } });
@Override public Double getValue() { return cache.getStatistics().cacheGetOperation().latency().average().value(); } });