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

perf: Add benchmarks to show the cost of attributes in Log #2741

Merged

Conversation

cijothomas
Copy link
Member

Just benches to later measure improvements in the area.

@cijothomas cijothomas requested a review from a team as a code owner March 3, 2025 18:17
Copy link

codecov bot commented Mar 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.4%. Comparing base (92303b6) to head (571ea35).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #2741     +/-   ##
=======================================
- Coverage   79.4%   79.4%   -0.1%     
=======================================
  Files        123     123             
  Lines      22770   22770             
=======================================
- Hits       18092   18089      -3     
- Misses      4678    4681      +3     

☔ 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.

LTTM. Thanks for adding this :)

}
});
});
});
Copy link
Member

@lalitb lalitb Mar 3, 2025

Choose a reason for hiding this comment

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

nit - courtesy AI :)

let mut fields = vec![("name", "CheckoutFailed"), ("message", "Unable to process checkout.")];

for i in 1..=num_attributes {
    fields.push((format!("field{}", i).as_str(), format!("field{}", i).as_str()));
}

error!(fields.iter().map(|(k, v)| (*k, *v)).collect::<Vec<_>>());

Copy link
Member Author

Choose a reason for hiding this comment

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

I don;t think that is doing what we want it to do.

We could potentially create a macro to achieve it, but the current one (though involves copy-paste) is quite easy to read and reason about.

@cijothomas cijothomas merged commit 46a7cd6 into open-telemetry:main Mar 3, 2025
23 checks passed
@cijothomas cijothomas deleted the cijothomas/bench-attribtue branch March 3, 2025 19:13
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