haridsv commented on code in PR #7136:
URL: https://github.com/apache/hbase/pull/7136#discussion_r2185282798


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFileReaderImpl.java:
##########
@@ -1114,6 +1115,15 @@ private HFileBlock getCachedBlock(BlockCacheKey 
cacheKey, boolean cacheBlock, bo
             compressedBlock.release();
           }
         }
+        boolean isScanMetricsEnabled = 
ThreadLocalServerSideScanMetrics.isScanMetricsEnabled();
+        if (isScanMetricsEnabled) {
+          int cachedBlockBytesRead = cachedBlock.getOnDiskSizeWithHeader();
+          // Account for the header size of the next block if it exists
+          if (cachedBlock.getNextBlockOnDiskSize() > 0) {
+            cachedBlockBytesRead += cachedBlock.headerSize();
+          }
+          
ThreadLocalServerSideScanMetrics.addBytesReadFromBlockCache(cachedBlockBytesRead);
+        }

Review Comment:
   The standalone count from MemStore/BlockCache is not important from 
understanding the performance characteristics, as they don't cost much so I 
feel these counts are more useful for accounting purpose (more for cross 
checking), so it is better to represent the actual count.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@hbase.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to