@Override public long value(T... results) { return compoundOp.compound(EnumSet.copyOf(Arrays.asList(results))).count().value(); }
/** * {@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} */ public long getCachePutSample() { long count = 0; for (String name : cacheManager.getCacheNames()) { Cache cache = cacheManager.getCache(name); if (cache != null) { count += cache.getStatistics().cachePutOperation().rate().value().longValue(); } } return count; }
/** * {@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} */ 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#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} * * @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; } }
@Override public long value(T result) { return compoundOp.component(result).count().value(); }
@Override public long getAverageGetTimeNanos() { return cache.getStatistics().cacheGetOperation().latency().average().value().longValue(); }
/** * {@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 getCacheUpdateRate() { long result = 0; for (String cacheName : getCacheNames()) { Ehcache cache = cacheManager.getEhcache(cacheName); if (cache != null) { result += cache.getStatistics().cachePutReplacedOperation().rate().value().longValue(); } } return result; }
/** * {@inheritDoc} */ public long getCacheOnDiskMissRate() { long result = 0; for (String cacheName : getCacheNames()) { Ehcache cache = cacheManager.getEhcache(cacheName); if (cache != null) { result += cache.getStatistics().localDiskMissOperation().rate().value().longValue(); } } return result; }
/** * {@inheritDoc} */ public long getCacheOffHeapMissRate() { long result = 0; for (String cacheName : getCacheNames()) { Ehcache cache = cacheManager.getEhcache(cacheName); if (cache != null) { result += cache.getStatistics().localOffHeapMissOperation().rate().value().longValue(); } } return result; }
@Override public long getNonStopSuccessMostRecentSample() { return cache.getStatistics().getExtended().nonstop().component(NonStopOperationOutcomes.SUCCESS).rate().value().longValue(); }
@Override public SampledCounter getCacheClusterOnlineSample() { return new SampledRateCounterProxy(cache.getStatistics().getExtended().clusterEvent().component(ClusterEventOutcomes.ONLINE).rate()); }
@Override public SampledCounter getCacheClusterOfflineSample() { return new SampledRateCounterProxy(cache.getStatistics().getExtended().clusterEvent().component(ClusterEventOutcomes.OFFLINE).rate()); }
/** * {@inheritDoc} */ public long getCacheHitSample() { long count = 0; for (String name : cacheManager.getCacheNames()) { Cache cache = cacheManager.getCache(name); if (cache != null) { count += cache.getStatistics().cacheHitOperation().rate().value().longValue(); } } return count; }
/** * {@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; }
/** * {@inheritDoc} */ public long getCacheEvictionRate() { long result = 0; for (String cacheName : getCacheNames()) { Ehcache cache = cacheManager.getEhcache(cacheName); if (cache != null) { result += cache.getStatistics().cacheEvictionOperation().rate().value().longValue(); } } return result; }
@Override public SampledCounter getNonStopTimeoutSample() { return new SampledRateCounterProxy(cache.getStatistics().getExtended().nonstop().component(NonStopOperationOutcomes.TIMEOUT).rate()); }