private long acceptableSize() { return (long) Math.floor(bucketAllocator.getTotalSize() * acceptableFactor); }
@VisibleForTesting long getPartitionSize(float partitionFactor) { return (long) Math.floor(bucketAllocator.getTotalSize() * partitionFactor * minFactor); }
private void validateGetPartitionSize(BucketCache bucketCache, float partitionFactor, float minFactor) { long expectedOutput = (long) Math.floor(bucketCache.getAllocator().getTotalSize() * partitionFactor * minFactor); assertEquals(expectedOutput, bucketCache.getPartitionSize(partitionFactor)); }
long totalSize = bucketAllocator.getTotalSize(); if (LOG.isDebugEnabled() && msgBuffer != null) { LOG.debug("Free started because \"" + why + "\"; " + msgBuffer.toString() +
public void logStats() { long totalSize = bucketAllocator.getTotalSize(); long usedSize = bucketAllocator.getUsedSize(); long freeSize = totalSize - usedSize; long cacheSize = getRealCacheSize(); LOG.info("failedBlockAdditions=" + cacheStats.getFailedInserts() + ", " + "totalSize=" + StringUtils.byteDesc(totalSize) + ", " + "freeSize=" + StringUtils.byteDesc(freeSize) + ", " + "usedSize=" + StringUtils.byteDesc(usedSize) +", " + "cacheSize=" + StringUtils.byteDesc(cacheSize) +", " + "accesses=" + cacheStats.getRequestCount() + ", " + "hits=" + cacheStats.getHitCount() + ", " + "IOhitsPerSecond=" + cacheStats.getIOHitsPerSecond() + ", " + "IOTimePerHit=" + String.format("%.2f", cacheStats.getIOTimePerHit())+ ", " + "hitRatio=" + (cacheStats.getHitCount() == 0 ? "0," : (StringUtils.formatPercent(cacheStats.getHitRatio(), 2)+ ", ")) + "cachingAccesses=" + cacheStats.getRequestCachingCount() + ", " + "cachingHits=" + cacheStats.getHitCachingCount() + ", " + "cachingHitsRatio=" +(cacheStats.getHitCachingCount() == 0 ? "0," : (StringUtils.formatPercent(cacheStats.getHitCachingRatio(), 2)+ ", ")) + "evictions=" + cacheStats.getEvictionCount() + ", " + "evicted=" + cacheStats.getEvictedCount() + ", " + "evictedPerRun=" + cacheStats.evictedPerEviction()); cacheStats.reset(); }
private long acceptableSize() { return (long) Math.floor(bucketAllocator.getTotalSize() * DEFAULT_ACCEPT_FACTOR); }
private long singleSize() { return (long) Math.floor(bucketAllocator.getTotalSize() * DEFAULT_SINGLE_FACTOR * DEFAULT_MIN_FACTOR); }
private long multiSize() { return (long) Math.floor(bucketAllocator.getTotalSize() * DEFAULT_MULTI_FACTOR * DEFAULT_MIN_FACTOR); }
private long memorySize() { return (long) Math.floor(bucketAllocator.getTotalSize() * DEFAULT_MEMORY_FACTOR * DEFAULT_MIN_FACTOR); }
private void validateGetPartitionSize(BucketCache bucketCache, float partitionFactor, float minFactor) { long expectedOutput = (long) Math.floor(bucketCache.getAllocator().getTotalSize() * partitionFactor * minFactor); assertEquals(expectedOutput, bucketCache.getPartitionSize(partitionFactor)); }
long totalSize=bucketAllocator.getTotalSize(); if (LOG.isDebugEnabled() && msgBuffer != null) { LOG.debug("Free started because \"" + why + "\"; " + msgBuffer.toString() +
public void logStats() { long totalSize = bucketAllocator.getTotalSize(); long usedSize = bucketAllocator.getUsedSize(); long freeSize = totalSize - usedSize; long cacheSize = getRealCacheSize(); LOG.info("failedBlockAdditions=" + cacheStats.getFailedInserts() + ", " + "totalSize=" + StringUtils.byteDesc(totalSize) + ", " + "freeSize=" + StringUtils.byteDesc(freeSize) + ", " + "usedSize=" + StringUtils.byteDesc(usedSize) +", " + "cacheSize=" + StringUtils.byteDesc(cacheSize) +", " + "accesses=" + cacheStats.getRequestCount() + ", " + "hits=" + cacheStats.getHitCount() + ", " + "IOhitsPerSecond=" + cacheStats.getIOHitsPerSecond() + ", " + "IOTimePerHit=" + String.format("%.2f", cacheStats.getIOTimePerHit())+ ", " + "hitRatio=" + (cacheStats.getHitCount() == 0 ? "0," : (StringUtils.formatPercent(cacheStats.getHitRatio(), 2)+ ", ")) + "cachingAccesses=" + cacheStats.getRequestCachingCount() + ", " + "cachingHits=" + cacheStats.getHitCachingCount() + ", " + "cachingHitsRatio=" +(cacheStats.getHitCachingCount() == 0 ? "0," : (StringUtils.formatPercent(cacheStats.getHitCachingRatio(), 2)+ ", ")) + "evictions=" + cacheStats.getEvictionCount() + ", " + "evicted=" + cacheStats.getEvictedCount() + ", " + "evictedPerRun=" + cacheStats.evictedPerEviction()); cacheStats.reset(); }