ethqunzhong commented on code in PR #4384: URL: https://github.com/apache/bookkeeper/pull/4384#discussion_r1636324625
########## bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/GarbageCollectorThread.java: ########## @@ -649,9 +666,11 @@ void doCompactEntryLogs(double threshold, long maxTimeMillis) throws EntryLogMet LOG.debug("Compaction ran for {}ms but was limited by {}ms", timeDiff, maxTimeMillis); } } - LOG.info( - "Compaction: entry log usage buckets[10% 20% 30% 40% 50% 60% 70% 80% 90% 100%] = {}, compacted {}", - entryLogUsageBuckets, compactedBuckets); + int totalEntryLogNum = Arrays.stream(entryLogUsageBuckets).sum(); + int compactedEntryLogNum = Arrays.stream(compactedBuckets).sum(); + this.entryLogCompactRatio = totalEntryLogNum == 0 ? 0 : (double) compactedEntryLogNum / totalEntryLogNum; Review Comment: make sence. udpate new metrics `entry_log_usage_buckets_le_*` to expose the whole bucket statistics. The metrics are as follows <img width="890" alt="image" src="https://github.com/apache/bookkeeper/assets/16517186/74e7451c-855a-4d78-86b8-f8976fc0180c"> -- 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: commits-unsubscr...@bookkeeper.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org