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

Proposal: simplify throttled logging in the codebase #172

Open
1 task done
678098 opened this issue Dec 13, 2023 · 0 comments
Open
1 task done

Proposal: simplify throttled logging in the codebase #172

678098 opened this issue Dec 13, 2023 · 0 comments
Labels
A-Broker Area: C++ Broker enhancement New feature or request

Comments

@678098
Copy link
Collaborator

678098 commented Dec 13, 2023

Is there an existing proposal for this?

  • I have searched the existing proposals

Is your feature request related to a problem?

Currently we have 3 ways to throttle logging:

  1. With mwcu::ThrottledActionParams:

    // Throttle error log if this is a 'failed Ack': note that we log at
    // INFO level in order not to overwhelm the dashboard, if a queue is
    // full, every post will nack, which could be a lot.
    MWCU_THROTTLEDACTION_THROTTLE(
    d_throttledFailedAckMessages,
    BALL_LOG_INFO << description() << ": failed Ack "

  2. With bdlmt::Throttle:

    if (d_alarmSoftLimiter.requestPermission()) {

  3. With BALL_LOGTHROTTLE:

    BALL_LOGTHROTTLE_INFO_BLOCK(k_MAX_INSTANT_MESSAGES, k_NS_PER_MESSAGE)

The good example of a problem: mqbblp::Cluster, here we have many-many fields responsible for throttled logging in the header:

mwcu::ThrottledActionParams d_throttledFailedPutMessages;
// Throttling parameters for failed PUT
// messages.
mwcu::ThrottledActionParams d_throttledSkippedPutMessages;
// Throttling parameters for dropped
// PUT messages.
mwcu::ThrottledActionParams d_throttledFailedAckMessages;
// Throttling parameters for failed ACK
// messages.
mwcu::ThrottledActionParams d_throttledDroppedAckMessages;
// Throttling parameters for dropped
// ACK messages.
mwcu::ThrottledActionParams d_throttledFailedConfirmMessages;
// Throttling parameters for failed
// CONFIRM messages.
mwcu::ThrottledActionParams d_throttledFailedRejectMessages;
// Throttling parameters for failed
// REJECT messages.
mwcu::ThrottledActionParams d_throttledDroppedConfirmMessages;
// Throttling parameters for dropped
// CONFIRM messages.
mwcu::ThrottledActionParams d_throttledDroppedRejectMessages;
// Throttling parameters for dropped
// REJECT messages.
mwcu::ThrottledActionParams d_throttledFailedPushMessages;
// Throttling parameters for failed
// PUSH messages.
mwcu::ThrottledActionParams d_throttledDroppedPushMessages;
// Throttling parameters for dropped
// PUSH messages.

Removing these fields by using a local BALL_LOGTHROTTLE will greatly simplify the class.

Describe the solution you'd like

Replace field-stored mwcu::ThrottledActionParams with local BALL_LOGTHROTTLE where it's possible.

Alternatives you considered

No response

@678098 678098 added enhancement New feature or request A-Broker Area: C++ Broker labels Dec 13, 2023
@678098 678098 changed the title Simplify throttled logging in the codebase Proposal: simplify throttled logging in the codebase Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Broker Area: C++ Broker enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant