-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 RemoveIf to attribute map, and rename Delete to Remove #4914
Add RemoveIf to attribute map, and rename Delete to Remove #4914
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4914 +/- ##
==========================================
- Coverage 91.04% 91.02% -0.02%
==========================================
Files 178 178
Lines 10617 10616 -1
==========================================
- Hits 9666 9663 -3
- Misses 734 736 +2
Partials 217 217 Continue to review full report at Codecov.
|
453002a
to
95c78d0
Compare
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.
LGTM, @codeboten @tigrannajaryan since this changes a bit more specifically Delete
-> Remove
, I want your opinion.
4c0c28a
to
5de260f
Compare
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.
No strong opinion on Delete vs Remove name. Works either way for me.
Correction: Remove/RemoveIf is preferable to be consistent with slices that have RemoveIf. |
Leaving the comment here, since it will be easier to read than in a thread... |
Thanks for confirming! |
cba5b29
to
f707dca
Compare
Uses `AttributeMap#RemoveIf` introduced in open-telemetry/opentelemetry-collector#4914, also see open-telemetry/opentelemetry-collector#4756
Uses `AttributeMap#RemoveIf` introduced in open-telemetry/opentelemetry-collector#4914, also see open-telemetry/opentelemetry-collector#4756
Description:
Fixes #4756 by adding RemoveIf for AttributeMap. The implementation (and TODO) are based on the RemoveIf for AttributeValueSlice: https://github.com/open-telemetry/opentelemetry-collector/blob/model/v0.43.1/model/pdata/generated_common.go#L181
Testing:
Unit tests added.
Benchmark added to compare performance of Remove to RemoveIf when deleting a large number of elements.