StevenLuMT commented on code in PR #3342:
URL: https://github.com/apache/bookkeeper/pull/3342#discussion_r903195614


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/SingleDirectoryDbLedgerStorage.java:
##########
@@ -191,8 +204,10 @@ public SingleDirectoryDbLedgerStorage(ServerConfiguration 
conf, LedgerManager le
 
         dbLedgerStorageStats = new DbLedgerStorageStats(
                 ledgerDirStatsLogger,
-            () -> writeCache.size() + writeCacheBeingFlushed.size(),
-            () -> writeCache.count() + writeCacheBeingFlushed.count(),
+            () -> this.isWriteCacheFixedLengthEnabled ? writeCache.size() + 
writeCacheBeingFlushed.size()
+                    + writeCacheLastFlushed.size() : writeCache.size() + 
writeCacheBeingFlushed.size(),
+            () -> this.isWriteCacheFixedLengthEnabled ? writeCache.count() + 
writeCacheBeingFlushed.count()
+                    + writeCacheLastFlushed.count() : writeCache.count() + 
writeCacheBeingFlushed.count(),

Review Comment:
   good suggestion



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to