this.metrics.compactionQueueSize.set(compactSplitThread
.getCompactionQueueSize());
this.metrics.flushQueueSize.set(cacheFlusher
.getFlushQueueSize());
LruBlockCache lruBlockCache = (LruBlockCache) StoreFile.getBlockCache(conf);
if (lruBlockCache != null) {
this.metrics.blockCacheCount.set(lruBlockCache.size());
this.metrics.blockCacheFree.set(lruBlockCache.getFreeSize());
this.metrics.blockCacheSize.set(lruBlockCache.getCurrentSize());
CacheStats cacheStats = lruBlockCache.getStats();
this.metrics.blockCacheHitCount.set(cacheStats.getHitCount());
this.metrics.blockCacheMissCount.set(cacheStats.getMissCount());
this.metrics.blockCacheEvictedCount.set(lruBlockCache.getEvictedCount());
double ratio = lruBlockCache.getStats().getHitRatio();
int percent = (int) (ratio * 100);
this.metrics.blockCacheHitRatio.set(percent);
ratio = lruBlockCache.getStats().getHitCachingRatio();
percent = (int) (ratio * 100);
this.metrics.blockCacheHitCachingRatio.set(percent);
}
}