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

Make metrics collection optional/faster #1147

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

QuerthDP
Copy link

@QuerthDP QuerthDP commented Dec 10, 2024

This patch contains:

  • Implementation of lock-free histogram with hot and cold bucket pools
  • Introduction of crate feature "metrics" to make using them optional
  • Functionality to gather latency statistics via histogram snapshots
  • WIP

Fixes: #330

Pre-review checklist

  • I have split my patch into logically separate commits.
  • All commit messages clearly explain what they change and why.
  • I added relevant tests for new features and bug fixes.
  • All commits compile, pass static checks and pass test.
  • PR description sums up the changes and reasons why they should be introduced.
  • I have provided docstrings for the public items that I want to introduce.
  • I have adjusted the documentation in ./docs/source/.
  • I added appropriate Fixes: annotations to PR description.

Implement a lock-free histogram with hot and cold bucket pools.
Implementation inspired by Prometheus library in Go and the histogram
crate.
Copy link

github-actions bot commented Dec 10, 2024

cargo semver-checks found no API-breaking changes in this PR! 🎉🥳
Checked commit: d989a59

I've added "metrics" crate feature which enables usage and gathering of metrics.

Therefore everyone willing to use metrics in their code is required to add "metrics" feature in their Cargo.toml file or compile otherwise with --features metrics flag.

This change was requested in scylladb#330
I've added histogram metrics used in cpp-rust-driver.

The snapshot of histogram statistics is taken under concurrency precautions using lock-free histogram features.

I've adjusted the docs book adding an example of taking the snapshot and accessing it's values.
@QuerthDP QuerthDP force-pushed the 330-make-metrics-collection-optional/faster branch from 74b7fa3 to d989a59 Compare December 11, 2024 10:50
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.

Make metrics collection optional/faster
2 participants