-
Notifications
You must be signed in to change notification settings - Fork 711
Add b3 format benchmark tests #1489
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
Add b3 format benchmark tests #1489
Conversation
6f04a20
to
215fe15
Compare
tracer = trace.TracerProvider().get_tracer("sdk_tracer_provider") | ||
with tracer.start_as_current_span("Root Span"): | ||
with tracer.start_as_current_span("Child Span"): | ||
benchmark(FORMAT.inject, dict.__setitem__, {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we be benchmarking a full context instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure I can add one, but I don't think there are any specs on this.
I noticed that on Java they don't have a complicated context as seen here.
But if we want I can add a context like this one I saw in the b3 unit tests
Let me know what we prefer!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there are any specs defined for benchmark testing in general. The purpose is to test the performance of the worst case performance impact. In this case it would be a full context with all fields defined properly and injected. As long as this condition is met it doesn't matter where you get it from.
But to answer your question, the b3 unit test span contexts looks appropriate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good! I've added a context to the inject
tests.
215fe15
to
781c433
Compare
@NathanielRN any thoughts on why the b3 benchmark tests take a long time ( |
@codeboten Super sorry but I don't think I'll be able to get to it for a while 😞, feel free to close this PR for now and I can revisit later. |
@NathanielRN no worries! i'll take a look after the next release is done. |
Description
Adds benchmarks for injecting and extract context from a span using the B3 propagator.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Adds results to the
tox -e test-core-sdk
test suite.Does This PR Require a Contrib Repo Change?
Checklist:
- [ ] Changelogs have been updated- [ ] Unit tests have been added- [ ] Documentation has been updated