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

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

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.28%. Comparing base (0f0e1f6) to head (9a7335f).
Report is 15 commits behind head on main.

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

❌ Your patch check 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.26%   91.28%   +0.02%     
==========================================
  Files         508      512       +4     
  Lines       28747    28790      +43     
==========================================
+ Hits        26235    26282      +47     
+ Misses       1994     1992       -2     
+ Partials      518      516       -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
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