Skip to content

Commit

Permalink
HBASE-28011 : The logStats about LruBlockCache is not accurate (#5344)
Browse files Browse the repository at this point in the history
  • Loading branch information
guluo2016 authored and virajjasani committed Aug 9, 2023
1 parent 5b2f793 commit f27659b
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1015,12 +1015,13 @@ public void run() {

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="
long usedSize = heapSize();
long freeSize = maxSize - usedSize;
LruBlockCache.LOG.info("totalSize=" + StringUtils.byteDesc(maxSize) + ", " + "usedSize="
+ StringUtils.byteDesc(usedSize) + ", " + "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) + ", "))
Expand Down

0 comments on commit f27659b

Please sign in to comment.