@Override public long getEvictedCount() { return lruCacheStats.getEvictedCount() + bucketCacheStats.getEvictedCount(); }
public double evictedPerEviction() { double evictionCount = getEvictionCount(); if (evictionCount == 0) { return 0; } return getEvictedCount() / evictionCount; }
private void __jamon_innerUnit__evictions_tmpl(final java.io.Writer jamonWriter, final BlockCache bc) throws java.io.IOException { // 171, 1 AgeSnapshot ageAtEvictionSnapshot = bc.getStats().getAgeAtEvictionSnapshot(); // Only show if non-zero mean and stddev as is the case in combinedblockcache // 175, 5 jamonWriter.write("<tr>\n <td>Evicted</td>\n <td>"); // 177, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", bc.getStats().getEvictedCount())), jamonWriter); // 177, 72 jamonWriter.write("</td>\n <td>The total number of blocks evicted</td>\n </tr>\n <tr>\n <td>Evictions</td>\n <td>"); // 182, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", bc.getStats().getEvictionCount())), jamonWriter); // 182, 73 jamonWriter.write("</td>\n <td>The total number of times an eviction has occurred</td>\n </tr>\n <tr>\n <td>Mean</td>\n <td>"); // 187, 13 org.jamon.escaping.Escaping.HTML.write(org.jamon.emit.StandardEmitter.valueOf(String.format("%,d", (long)ageAtEvictionSnapshot.getMean())), jamonWriter); // 187, 78 jamonWriter.write("</td>\n <td>Mean age of Blocks at eviction time (seconds)</td>\n </tr>\n"); }
@Override public String toString() { AgeSnapshot snapshot = getAgeAtEvictionSnapshot(); return "hitCount=" + getHitCount() + ", hitCachingCount=" + getHitCachingCount() + ", missCount=" + getMissCount() + ", missCachingCount=" + getMissCachingCount() + ", evictionCount=" + getEvictionCount() + ", evictedBlockCount=" + getEvictedCount() + ", primaryMissCount=" + getPrimaryMissCount() + ", primaryHitCount=" + getPrimaryHitCount() + ", evictedAgeMean=" + snapshot.getMean(); }
long blockedFlushCnt; long unblockedFlushCnt; curEvictCount = blockCache.getStats().getEvictedCount(); tunerContext.setEvictCount(curEvictCount - evictCount); evictCount = curEvictCount;
assertTrue(toBeTested.getStats().getEvictedCount() > 0);
public void logStats() { // Log size long totalSize = heapSize(); long freeSize = maxSize - totalSize; LruBlockCache.LOG.info("totalSize=" + StringUtils.byteDesc(totalSize) + ", " + "freeSize=" + StringUtils.byteDesc(freeSize) + ", " + "max=" + StringUtils.byteDesc(this.maxSize) + ", " + "blockCount=" + getBlockCount() + ", " + "accesses=" + stats.getRequestCount() + ", " + "hits=" + stats.getHitCount() + ", " + "hitRatio=" + (stats.getHitCount() == 0 ? "0" : (StringUtils.formatPercent(stats.getHitRatio(), 2)+ ", ")) + ", " + "cachingAccesses=" + stats.getRequestCachingCount() + ", " + "cachingHits=" + stats.getHitCachingCount() + ", " + "cachingHitsRatio=" + (stats.getHitCachingCount() == 0 ? "0,": (StringUtils.formatPercent(stats.getHitCachingRatio(), 2) + ", ")) + "evictions=" + stats.getEvictionCount() + ", " + "evicted=" + stats.getEvictedCount() + ", " + "evictedPerRun=" + stats.evictedPerEviction()); }
assertTrue("blockcache should contain blocks. disabledBlockCount=" + disabledBlockCount, disabledBlockCount > 0); long disabledEvictedCount = disabledBlockCache.getStats().getEvictedCount(); for (Map.Entry<BlockCacheKey, LruCachedBlock> e : disabledBlockCache.getMapForTests().entrySet()) { assertTrue("blockcache should contain blocks. enabledBlockCount=" + enabledBlockCount, enabledBlockCount > 0); long enabledEvictedCount = enabledBlockCache.getStats().getEvictedCount(); int candidatesFound = 0; for (Map.Entry<BlockCacheKey, LruCachedBlock> e :
long startHit = cs.getHitCount(); long startMiss = cs.getMissCount(); long startEvicted = cs.getEvictedCount(); assertEquals(startHit, cs.getHitCount()); assertEquals(startMiss + 3, cs.getMissCount()); assertEquals(startEvicted, cs.getEvictedCount()); startMiss += 3; scanner.close(); assertEquals(startHit + 3, cs.getHitCount()); assertEquals(startMiss, cs.getMissCount()); assertEquals(startEvicted, cs.getEvictedCount()); startHit += 3; scanner.close(); assertEquals(startHit + 6, cs.getHitCount()); assertEquals(startMiss, cs.getMissCount()); assertEquals(startEvicted, cs.getEvictedCount()); startHit += 6; scannerOne.close(); assertEquals(startEvicted, cs.getEvictedCount()); assertEquals(startEvicted, cs.getEvictedCount());
assertEquals(4, cache.getStats().getEvictedCount()); assertEquals(16, cache.getStats().getEvictedCount());
private void addDataAndHits(final BlockCache bc, final int count) { Cacheable dce = new DataCacheEntry(); Cacheable ice = new IndexCacheEntry(); for (int i = 0; i < count; i++) { BlockCacheKey bckd = new BlockCacheKey("f", i); BlockCacheKey bcki = new BlockCacheKey("f", i + count); bc.getBlock(bckd, true, false, true); bc.cacheBlock(bckd, dce); bc.cacheBlock(bcki, ice); bc.getBlock(bckd, true, false, true); bc.getBlock(bcki, true, false, true); } assertEquals(2 * count /*Data and Index blocks*/, bc.getStats().getHitCount()); BlockCacheKey bckd = new BlockCacheKey("f", 0); BlockCacheKey bcki = new BlockCacheKey("f", 0 + count); bc.evictBlock(bckd); bc.evictBlock(bcki); bc.getStats().getEvictedCount(); }
assertEquals(1, cache.getStats().getEvictedCount()); assertEquals(2, cache.getStats().getEvictedCount()); assertEquals(6, cache.getStats().getEvictedCount()); assertEquals(9, cache.getStats().getEvictedCount()); assertEquals(10, cache.getStats().getEvictedCount()); assertEquals(11, cache.getStats().getEvictedCount());
assertEquals(1, cache.getStats().getEvictedCount()); assertEquals(2, cache.getStats().getEvictedCount()); assertEquals(3, cache.getStats().getEvictedCount()); assertEquals(6, cache.getStats().getEvictedCount()); assertEquals(9, cache.getStats().getEvictedCount()); assertEquals(12, cache.getStats().getEvictedCount());
assertEquals(15, cache.getStats().getEvictedCount());
assertEquals(2, cache.getStats().getEvictedCount());
/** * Get the number of blocks that have been evicted during the lifetime * of this cache. */ public long getEvictedCount() { return this.stats.getEvictedCount(); }
@Override public long getEvictedCount() { return lruCacheStats.getEvictedCount() + bucketCacheStats.getEvictedCount(); }
@Override public long getBlockCacheEvictedCount() { if (this.cacheStats == null) { return 0; } return this.cacheStats.getEvictedCount(); }
public long getEvictedCount() { return stats.getEvictedCount(); }
@Override public String toString() { AgeSnapshot snapshot = getAgeAtEvictionSnapshot(); return "hitCount=" + getHitCount() + ", hitCachingCount=" + getHitCachingCount() + ", missCount=" + getMissCount() + ", missCachingCount=" + getMissCachingCount() + ", evictionCount=" + getEvictionCount() + ", evictedBlockCount=" + getEvictedCount() + ", primaryMissCount=" + getPrimaryMissCount() + ", primaryHitCount=" + getPrimaryHitCount() + ", evictedAgeMean=" + snapshot.getMean() + ", evictedAgeStdDev=" + snapshot.getStdDev(); }