You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by "lifepuzzlefun (via GitHub)" <gi...@apache.org> on 2023/10/15 09:32:56 UTC

[PR] Fix ledgerHandle pendingAddEntries stats [bookkeeper]

lifepuzzlefun opened a new pull request, #4104:
URL: https://github.com/apache/bookkeeper/pull/4104

   ### Motivation
   Current LedgerHandle stats NUM_PENDING_ADD only record the first LedgerHandle create by bookkeeper instance.
   if we need record all LedgerHandle at bookkeeper instance level the goal fail.
   
   ### Changes
   1. Record all LedgerHandle instance in static field.
   2. register NUM_PENDING_ADD gauge by sum all ledgerHandle pendingAppOp queue size.
   3. remove LedgerHandle from static field when handle is closed.
   4. add new metric NUM_OPEN_LEDGER_HANDLE to expose all open LedgerHandle numbers by this bookkeeper client.
   


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

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


Re: [PR] Fix ledgerHandle pendingAddEntries stats [bookkeeper]

Posted by "hangc0276 (via GitHub)" <gi...@apache.org>.
hangc0276 commented on code in PR #4104:
URL: https://github.com/apache/bookkeeper/pull/4104#discussion_r1372699004


##########
bookkeeper-server/src/main/java/org/apache/bookkeeper/client/LedgerHandle.java:
##########
@@ -92,6 +92,8 @@
  * write operations to a ledger.
  */
 public class LedgerHandle implements WriteHandle {
+    public static Set<LedgerHandle> INSTANCES = ConcurrentHashMap.newKeySet();

Review Comment:
   Store the LedgerHandle object will bring extra memory overload for the client.



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

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