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

Added ActivityEvent.EnumerateTags & ActivityLink.EnumerateTags extensions #1320

Merged

Conversation

CodeBlanch
Copy link
Member

@CodeBlanch CodeBlanch commented Oct 4, 2020

Added extension methods for enumerating tags on Activity Events & Links without allocation. Updated Jaeger. Removed some code from the EnumerationHelper that is no longer needed. Renamed Activity.EnumerateTagValues -> Activity.EnumerateTags.

Method Mean Error StdDev Gen 0 Gen 1 Gen 2 Allocated
EnumerateNonemptyActivityLinkTags 68.63 ns 1.380 ns 2.022 ns 0.0057 - - 48 B
EnumerateLinksNonemptyActivityLinkTags 46.23 ns 0.798 ns 0.747 ns - - - -
EnumerateNonemptyActivityEventTags 67.04 ns 1.344 ns 1.320 ns 0.0057 - - 48 B
EnumerateLinksNonemptyActivityEventTags 46.22 ns 0.887 ns 1.122 ns - - - -

TODOs:

  • CHANGELOG.md updated for non-trivial changes
  • Changes in public API reviewed

@CodeBlanch CodeBlanch requested a review from a team October 4, 2020 17:55
@codecov
Copy link

codecov bot commented Oct 4, 2020

Codecov Report

Merging #1320 into master will increase coverage by 0.07%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1320      +/-   ##
==========================================
+ Coverage   83.81%   83.88%   +0.07%     
==========================================
  Files         347      347              
  Lines       13362    13412      +50     
==========================================
+ Hits        11199    11251      +52     
+ Misses       2163     2161       -2     
Impacted Files Coverage Δ
...ZPages/Implementation/ZPagesExporterEventSource.cs 56.25% <0.00%> (-6.25%) ⬇️
...et/src/OpenTelemetry/Internal/EnumerationHelper.cs 87.09% <0.00%> (-1.48%) ⬇️
....Jaeger/Implementation/JaegerActivityExtensions.cs 96.59% <0.00%> (-0.12%) ⬇️
...penTelemetry.Tests/Trace/ActivityExtensionsTest.cs 100.00% <0.00%> (ø)
.../src/OpenTelemetry.Api/Trace/ActivityExtensions.cs 99.09% <0.00%> (+0.24%) ⬆️
...ingRequestsCollectionsIsAccordingToTheSpecTests.cs 95.91% <0.00%> (+2.04%) ⬆️
...nTelemetry/Internal/OpenTelemetrySdkEventSource.cs 80.95% <0.00%> (+3.17%) ⬆️

Copy link
Contributor

@eddynaka eddynaka left a comment

Choose a reason for hiding this comment

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

It's a nice improvement!

nit: we should somehow try to merge all this functions to one, since all looks the same...not sure if that's feasible

@CodeBlanch
Copy link
Member Author

@eddynaka I combined ActivityTagObjectsEnumeratorFactory & ActivityTagsCollectionEnumeratorFactory into ActivityTagsEnumeratorFactory. So now there are 3 factories: 1 for tags (activity.TagObjects, activityLink.Tags, & activityEvent.Tags), 1 for events (activity.Events), & 1 for links (activity.Links). How's that?

Copy link
Contributor

@eddynaka eddynaka left a comment

Choose a reason for hiding this comment

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

LGTM

@CodeBlanch CodeBlanch merged commit 55526ef into open-telemetry:master Oct 8, 2020
@CodeBlanch CodeBlanch deleted the activity-childtagextensions branch October 8, 2020 21:56
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.

3 participants