Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
merged 12 commits into from
Jan 21, 2021

Conversation

NathanielRN
Copy link
Contributor

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.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Adds results to the tox -e test-core-sdk test suite.

Does This PR Require a Contrib Repo Change?

  • No.

Checklist:

  • Followed the style guidelines of this project
    - [ ] Changelogs have been updated
    - [ ] Unit tests have been added
    - [ ] Documentation has been updated

@NathanielRN NathanielRN requested review from a team, owais and hectorhdzg and removed request for a team December 16, 2020 20:25
@NathanielRN NathanielRN force-pushed the add-b3-performance-tests branch from 6f04a20 to 215fe15 Compare December 17, 2020 00:33
@owais owais added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Dec 24, 2020
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__, {})
Copy link
Contributor

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?

Copy link
Contributor Author

@NathanielRN NathanielRN Jan 11, 2021

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!

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@NathanielRN NathanielRN requested a review from lzchen January 11, 2021 05:17
@NathanielRN NathanielRN force-pushed the add-b3-performance-tests branch from 215fe15 to 781c433 Compare January 12, 2021 22:49
codeboten
codeboten approved these changes Jan 14, 2021
@codeboten
Copy link
Contributor

@NathanielRN any thoughts on why the b3 benchmark tests take a long time (221m) in pypy3? It looks like the tests pass successfully then get hung up somewhere, any chance you could take a look?

@NathanielRN
Copy link
Contributor Author

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

@codeboten
Copy link
Contributor

@NathanielRN no worries! i'll take a look after the next release is done.

@codeboten codeboten merged commit 4083cac into open-telemetry:master Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog PRs that do not require a CHANGELOG.md entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants