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

Update metric benchmarks #1907

Merged

Conversation

utpilla
Copy link
Contributor

@utpilla utpilla commented Jul 2, 2024

Changes

  • Update metrics benchmarks for API
  • Use iter_batched method to generate the dynamic attributes before each iteration

@utpilla utpilla requested a review from a team as a code owner July 2, 2024 21:59
Copy link

codecov bot commented Jul 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.0%. Comparing base (ae6e2ff) to head (d80580e).

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1907   +/-   ##
=====================================
  Coverage   75.0%   75.0%           
=====================================
  Files        122     122           
  Lines      20289   20289           
=====================================
+ Hits       15221   15222    +1     
+ Misses      5068    5067    -1     

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

Copy link
Member

@lalitb lalitb left a comment

Choose a reason for hiding this comment

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

Thanks for fixing these. Should we also add the benchmarks results as done here -

// Results:
// CreateOTelValueString 1-2 ns
// CreateOTelAnyValueString 15 ns
// CreateOTelValueInt 1-2 ns
// CreateOTelAnyValueInt 15 ns

also add the machine configuration used for testing.

opentelemetry/benches/metrics.rs Outdated Show resolved Hide resolved
| NoAttributes | 1.1616 ns |
| AddWithInlineStaticAttributes | 13.296 ns |
| AddWithStaticArray | 1.1612 ns |
| AddWithDynamicAttributes | 110.40 ns |
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This benchmark method runs much faster when run in isolation. It takes around 80 ns instead of 110 ns.

@cijothomas cijothomas merged commit 31a3491 into open-telemetry:main Jul 3, 2024
25 checks passed
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.

None yet

3 participants