Skip to content

Improvements #183

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

Merged
merged 3 commits into from
May 23, 2025
Merged

Improvements #183

merged 3 commits into from
May 23, 2025

Conversation

NelsonVides
Copy link
Member

Two things for histograms: when fetching for the buckets, lookup (and therefore only copy) the bucket config instead of the entire record). Second, keep buckets as a big tuple instead of a big list, which is smaller and therefore cheaper to copy, and also can apply binary search during the bucket lookup instead of linear search over a list.

Also for gauges, improve their performance and fix a bug about setting a gauge to undefined for integer or floats.

Extracting from #177

Copy link

codecov bot commented May 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Files with missing lines Coverage Δ
src/metrics/prometheus_gauge.erl 96.55% <100.00%> (ø)
src/metrics/prometheus_histogram.erl 95.72% <100.00%> (-0.03%) ⬇️
src/prometheus_buckets.erl 100.00% <100.00%> (+2.70%) ⬆️
src/prometheus_time.erl 97.43% <100.00%> (ø)
test/eunit/metric/prometheus_gauge_tests.erl 97.87% <100.00%> (+0.11%) ⬆️
test/eunit/prometheus_buckets_tests.erl 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Two things: when fetching for the buckets, lookup (and therefore only
copy) the bucket config instead of the entire record). Second, keep
buckets as a big tuple instead of a big list, which is smaller and
therefore cheaper to copy, and also can apply binary search during the
bucket lookup instead of linear search over a list.
@NelsonVides NelsonVides merged commit d11020e into master May 23, 2025
4 checks passed
@NelsonVides NelsonVides deleted the improvements branch May 23, 2025 18:54
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.

2 participants