@Test public void testClearStatistics() throws InterruptedException { Cache cache = new Cache("test", 1, true, false, 5, 2); manager.addCache(cache); cache.setStatisticsEnabled(true); cache.put(new Element("key1", "value1")); cache.put(new Element("key2", "value1")); Thread.sleep(100); cache.get("key1"); cache.get("key2"); Statistics statistics = cache.getStatistics(); assertEquals(2, statistics.getCacheHits()); assertEquals(1, statistics.getOnDiskHits()); assertEquals(1, statistics.getInMemoryHits()); assertEquals(0, statistics.getCacheMisses()); statistics.clearStatistics(); statistics = cache.getStatistics(); assertEquals(0, statistics.getCacheHits()); assertEquals(0, statistics.getOnDiskHits()); assertEquals(0, statistics.getInMemoryHits()); assertEquals(0, statistics.getCacheMisses()); }
public void clearStatistics() { if (cache == null) { throw new IllegalStateException("This statistics object no longer references a Cache."); } cache.clearStatistics(); }
Statistics implements Serializable { public void clearStatistics() { if (cache == null) { throw new IllegalStateException("This statistics object no longer references a Cache."); } cache.clearStatistics(); } }
Statistics implements Serializable { public void clearStatistics() { if (cache == null) { throw new IllegalStateException("This statistics object no longer references a Cache."); } cache.clearStatistics(); } Statistics(Ehcache cache, int statisticsAccuracy, long cacheHits, long onDiskHits, long offHeapHits,
                      long inMemoryHits, long misses, long onDiskMisses, long offHeapMisses,
                      long inMemoryMisses, long size, float averageGetTime, long evictionCount,
                      long memoryStoreSize, long offHeapStoreSize, long diskStoreSize, long searchesPerSecond,
                      long averageSearchTime, long writerQueueLength); }
Statistics implements Serializable { public void clearStatistics() { if (cache == null) { throw new IllegalStateException("This statistics object no longer references a Cache."); } cache.clearStatistics(); } Statistics(Ehcache cache, int statisticsAccuracy, long cacheHits, long onDiskHits, long offHeapHits,
                      long inMemoryHits, long misses, long onDiskMisses, long offHeapMisses,
                      long inMemoryMisses, long size, float averageGetTime, long evictionCount,
                      long memoryStoreSize, long offHeapStoreSize, long diskStoreSize, long searchesPerSecond,
                      long averageSearchTime, long writerQueueLength); void clearStatistics(); long getCacheHits(); long getInMemoryHits(); long getOffHeapHits(); long getOnDiskHits(); long getCacheMisses(); long getInMemoryMisses(); long getOffHeapMisses(); long getOnDiskMisses(); long getObjectCount(); long getMemoryStoreObjectCount(); long getOffHeapStoreObjectCount(); long getDiskStoreObjectCount(); int getStatisticsAccuracy(); String getStatisticsAccuracyDescription(); String getAssociatedCacheName(); Ehcache getAssociatedCache(); @Override final String toString(); float getAverageGetTime(); long getEvictionCount(); long getAverageSearchTime(); long getSearchesPerSecond(); static boolean isValidStatisticsAccuracy(int statisticsAccuracy); long getWriterQueueSize(); }
Statistics implements Serializable { public void clearStatistics() { if (cache == null) { throw new IllegalStateException("This statistics object no longer references a Cache."); } cache.clearStatistics(); } Statistics(Ehcache cache, int statisticsAccuracy, long cacheHits, long onDiskHits, long offHeapHits,
                      long inMemoryHits, long misses, long onDiskMisses, long offHeapMisses,
                      long inMemoryMisses, long size, float averageGetTime, long evictionCount,
                      long memoryStoreSize, long offHeapStoreSize, long diskStoreSize, long searchesPerSecond,
                      long averageSearchTime, long writerQueueLength); void clearStatistics(); long getCacheHits(); long getInMemoryHits(); long getOffHeapHits(); long getOnDiskHits(); long getCacheMisses(); long getInMemoryMisses(); long getOffHeapMisses(); long getOnDiskMisses(); long getObjectCount(); long getMemoryStoreObjectCount(); long getOffHeapStoreObjectCount(); long getDiskStoreObjectCount(); int getStatisticsAccuracy(); String getStatisticsAccuracyDescription(); String getAssociatedCacheName(); Ehcache getAssociatedCache(); @Override final String toString(); float getAverageGetTime(); long getEvictionCount(); long getAverageSearchTime(); long getSearchesPerSecond(); static boolean isValidStatisticsAccuracy(int statisticsAccuracy); long getWriterQueueSize(); static final int STATISTICS_ACCURACY_NONE; static final int STATISTICS_ACCURACY_BEST_EFFORT; static final int STATISTICS_ACCURACY_GUARANTEED; }