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

MINOR: inline metrics in RecordAccumulator #12227

Merged
merged 2 commits into from
Jun 1, 2022

Conversation

dajac
Copy link
Contributor

@dajac dajac commented May 30, 2022

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

Copy link
Contributor

@hachikuji hachikuji left a comment

Choose a reason for hiding this comment

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

LGTM. Minor suggestion for consideration (no need for additional review).

}
};
metrics.addMetric(metricName, totalBytes);
metricName = metrics.metricName("buffer-total-bytes", metricGrpName,
Copy link
Contributor

Choose a reason for hiding this comment

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

While we're at it, these redefinitions are a little annoying. Could we create a little helper or just use different variables? e.g.:

        MetricName waitingThreadsName = metrics.metricName("waiting-threads", metricGrpName,
            "The number of user threads blocked waiting for buffer memory to enqueue their records");
        metrics.addMetric(waitingThreadsName, (config, now) -> free.queued());
...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree. I have refactored it.

@dajac dajac merged commit 283a995 into apache:trunk Jun 1, 2022
@dajac dajac deleted the minor-use-lambdas-for-metrics branch June 1, 2022 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants