Skip to content

Introduce FromLocationIndices and PutLocation #13150

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 22 commits into from
Jun 12, 2025

Conversation

dmathieu
Copy link
Member

@dmathieu dmathieu commented Jun 4, 2025

Description

This introduces the FromLocationIndices and PutLocation methods, as we have for attributes.
https://github.com/open-telemetry/opentelemetry-collector/blob/main/pdata/pprofile/attributes.go

The intent is to be able to use this to perform merging/batching of profiles.
I will be adding similar methods for the other tables once the concept of this first PR is validated.

Benchmark Results

goos: darwin
goarch: arm64
pkg: go.opentelemetry.io/collector/pdata/pprofile
cpu: Apple M1 Max
BenchmarkFromLocationIndices-10                                                  7058838               171.7 ns/op           308 B/op          7 allocs/op
BenchmarkPutLocation/with_a_new_location-10                                     47819084                24.13 ns/op           16 B/op          1 allocs/op
BenchmarkPutLocation/with_an_existing_location-10                               47871942                23.71 ns/op           16 B/op          1 allocs/op
BenchmarkPutLocation/with_a_duplicate_location-10                               49755453                23.80 ns/op           16 B/op          1 allocs/op
BenchmarkPutLocation/with_a_hundred_locations_to_loop_through-10                47431298                24.13 ns/op           16 B/op          1 allocs/op

@github-actions github-actions bot requested review from bogdandrutu and dmitryax June 4, 2025 12:18
Copy link

codecov bot commented Jun 4, 2025

Codecov Report

Attention: Patch coverage is 83.63636% with 9 lines in your changes missing coverage. Please review.

Project coverage is 91.27%. Comparing base (4ddf2cc) to head (2ed840d).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
pdata/pprofile/locations.go 75.00% 6 Missing and 3 partials ⚠️

❌ Your patch status has failed because the patch coverage (83.63%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13150      +/-   ##
==========================================
- Coverage   91.28%   91.27%   -0.01%     
==========================================
  Files         511      514       +3     
  Lines       28802    28857      +55     
==========================================
+ Hits        26291    26340      +49     
- Misses       1994     1998       +4     
- Partials      517      519       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dmathieu dmathieu marked this pull request as ready for review June 4, 2025 12:47
@dmathieu dmathieu requested review from mx-psi and a team as code owners June 4, 2025 12:47
@mx-psi mx-psi added this pull request to the merge queue Jun 12, 2025
Merged via the queue into open-telemetry:main with commit 4263e8d Jun 12, 2025
53 of 54 checks passed
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