-
Notifications
You must be signed in to change notification settings - Fork 111
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 tests of an example sampler based on attributes #568
Conversation
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## main #568 +/- ##
=======================================
Coverage 38.13% 38.13%
=======================================
Files 61 61
Lines 3598 3598
=======================================
Hits 1372 1372
Misses 2226 2226
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
This was mainly done to test the example code to be used on opentelemetry.io for Sampler docs but it also does do some useful testing of the sampler and provides some example code.
f4aebe3
to
2d587cf
Compare
Argh, |
9c6cc27
to
c82a389
Compare
Eh, I made it a more efficient matching instead of changing it to only run on 24+. Just means now I need to update the website docs. |
|
||
has_match(A, B) -> | ||
I = maps:iterator(A), | ||
has_match_(maps:next(I), B). |
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.
Would it be faster if you picked the smallest map to iterate from to compare with the other, since you're going for exact matches? Something like:
{Min,Max} = if maps:size(A) < maps:size(B) -> {A, B};
true -> {B, A}
end,
I = maps:iterator(Min),
has_match_(maps:next(I), Max).
That'd ensure always having a constantly shorter iteration, though I figured the configured map won't be too big and will often be smallest.
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.
Yea. I wasn't worried about performance. That's why it was originally using intersection
.
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.
But may as well since people may actually use this in their own sampler, so I updated it.
No description provided.