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

Rename ForEach with Range to be consistent with sync.Map #2931

Merged
merged 3 commits into from
Apr 15, 2021

Conversation

bogdandrutu
Copy link
Member

@bogdandrutu bogdandrutu commented Apr 14, 2021

Updates #2488

Signed-off-by: Bogdan Drutu [email protected]

@bogdandrutu bogdandrutu requested a review from a team April 14, 2021 17:47
@codecov
Copy link

codecov bot commented Apr 14, 2021

Codecov Report

Merging #2931 (4fee89a) into main (03c7bf9) will increase coverage by 0.01%.
The diff coverage is 97.61%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2931      +/-   ##
==========================================
+ Coverage   91.66%   91.68%   +0.01%     
==========================================
  Files         312      312              
  Lines       15317    15338      +21     
==========================================
+ Hits        14041    14062      +21     
  Misses        870      870              
  Partials      406      406              
Impacted Files Coverage Δ
translator/internaldata/resource_to_oc.go 94.20% <66.66%> (+0.08%) ⬆️
consumer/pdata/common.go 98.92% <100.00%> (+<0.01%) ⬆️
exporter/exporterhelper/resource_to_label.go 100.00% <100.00%> (ø)
exporter/loggingexporter/logging_exporter.go 96.46% <100.00%> (+0.06%) ⬆️
exporter/prometheusexporter/accumulator.go 99.00% <100.00%> (+<0.01%) ⬆️
exporter/prometheusexporter/collector.go 98.59% <100.00%> (+<0.01%) ⬆️
translator/internaldata/metrics_to_oc.go 97.85% <100.00%> (+0.02%) ⬆️
translator/internaldata/traces_to_oc.go 93.89% <100.00%> (+0.02%) ⬆️
translator/trace/jaeger/traces_to_jaegerproto.go 93.65% <100.00%> (+0.05%) ⬆️
translator/trace/protospan_translation.go 92.46% <100.00%> (+0.05%) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 03c7bf9...4fee89a. Read the comment docs.

// ...
// })
func (am AttributeMap) ForEach(f func(k string, v AttributeValue)) {
func (am AttributeMap) Range(f func(k string, v AttributeValue)) {
Copy link
Member

Choose a reason for hiding this comment

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

If we aim for consistency also make f return bool to stop iteration like sync.Map.Range does. That's useful for search operations.

Copy link
Member Author

Choose a reason for hiding this comment

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

@tigrannajaryan sure, changed :)

Copy link
Member

@tigrannajaryan tigrannajaryan left a comment

Choose a reason for hiding this comment

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

LGTM

@bogdandrutu bogdandrutu merged commit f6074af into open-telemetry:main Apr 15, 2021
@bogdandrutu bogdandrutu deleted the range branch April 15, 2021 21:27
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.

2 participants