Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ledgerHandle pendingAddEntries stats #4104

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

lifepuzzlefun
Copy link
Contributor

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.

@@ -92,6 +92,8 @@
* write operations to a ledger.
*/
public class LedgerHandle implements WriteHandle {
public static Set<LedgerHandle> INSTANCES = ConcurrentHashMap.newKeySet();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants