You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2022/08/10 15:14:49 UTC

[GitHub] [bookkeeper] michaeljmarshall commented on a diff in pull request #3444: Add latency stats for entry location index lookup so that possible RocksDB bottleneck can be detected

michaeljmarshall commented on code in PR #3444:
URL: https://github.com/apache/bookkeeper/pull/3444#discussion_r942579938


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/storage/ldb/EntryLocationIndex.java:
##########
@@ -73,18 +74,28 @@ public long getLocation(long ledgerId, long entryId) throws IOException {
         LongPairWrapper key = LongPairWrapper.get(ledgerId, entryId);
         LongWrapper value = LongWrapper.get();
 
+        long startTimeNanos = MathUtils.nowInNano();
+        boolean operationSuccess = false;
         try {
             if (locationsDb.get(key.array, value.array) < 0) {
                 if (log.isDebugEnabled()) {
                     log.debug("Entry not found {}@{} in db index", ledgerId, entryId);
                 }
                 return 0;
             }
-
+            operationSuccess = true;
             return value.getValue();
         } finally {
             key.recycle();
             value.recycle();
+            long eventLatencyMillis = MathUtils.elapsedNanos(startTimeNanos);

Review Comment:
   Nit
   ```suggestion
               long eventLatencyNanos = MathUtils.elapsedNanos(startTimeNanos);
   ```



-- 
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-unsubscribe@bookkeeper.apache.org

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