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 histogram collect benchmark #2268

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fraillt
Copy link
Contributor

@fraillt fraillt commented Nov 3, 2024

Changes

There are two problems with current benchmark for histogram collection:

  • it simply doesn't work...
cargo bench --bench metric Histogram/Collect
   Compiling opentelemetry_sdk v0.26.0 (/home/fraillt/Projects/opentelemetry-rust/opentelemetry-sdk)
    Finished `bench` profile [optimized + debuginfo] target(s) in 5.46s
     Running benches/metric.rs (target/release/deps/metric-36200279505f7f44)
Gnuplot not found, using plotters backend
Benchmarking Histogram/CollectOne: Warming up for 3.0000 sthread 'main' panicked at opentelemetry-sdk/benches/metric.rs:398:36:
index out of bounds: the len is 0 but the index is 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
  • it only test case where measurements has 0 attributes

This revision fixes first problem, and broadens scope of measuring more combinations:

    for metrics_count in [1, 20] {
        for (attribute_sets_count, attribs_count) in [(1, 0), (1, 10), (500, 10)] {
        ...
        }
    }

Please provide a brief description of the changes here.

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@fraillt fraillt requested a review from a team as a code owner November 3, 2024 10:07
@fraillt fraillt force-pushed the fix-histogram-collect-benchmark branch from 2ae410f to 1e5fff3 Compare November 3, 2024 10:08
Copy link

codecov bot commented Nov 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.4%. Comparing base (fcd7cae) to head (1e5fff3).

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #2268     +/-   ##
=======================================
- Coverage   79.4%   79.4%   -0.1%     
=======================================
  Files        121     121             
  Lines      20981   20981             
=======================================
- Hits       16673   16671      -2     
- Misses      4308    4310      +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

1 participant