Skip to content

Introduce SetString on profiles #13225

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 2 commits into
base: main
Choose a base branch
from

Conversation

dmathieu
Copy link
Member

Description

This is part of #13106
It introduces a new SetString method, which allows setting string values into the string table, or retrieving their existing index.

This doesn't work like the other methods, as string indices aren't always stored on the same attribute. So we can't assign the ID directly.

@github-actions github-actions bot requested review from bogdandrutu and dmitryax June 17, 2025 11:46
Copy link

codecov bot commented Jun 17, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 91.53%. Comparing base (e7b140f) to head (8599651).

Files with missing lines Patch % Lines
pdata/pprofile/string_table.go 50.00% 4 Missing and 2 partials ⚠️

❌ Your patch check has failed because the patch coverage (50.00%) 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   #13225      +/-   ##
==========================================
- Coverage   91.54%   91.53%   -0.02%     
==========================================
  Files         522      523       +1     
  Lines       28955    28967      +12     
==========================================
+ Hits        26508    26514       +6     
- Misses       1931     1935       +4     
- Partials      516      518       +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 17, 2025 12:18
@dmathieu dmathieu requested review from mx-psi and a team as code owners June 17, 2025 12:18
Comment on lines +15 to +16
// SetString updates a StringTable, adding or providing a value and returns its index.
func SetString(table pcommon.StringSlice, val string) (int32, error) {
Copy link
Member

Choose a reason for hiding this comment

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

LoadOrStore to be consistent with https://pkg.go.dev/sync#Map.LoadOrStore?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, but then that'd be inconsistent with SetMapping, SetFunction, and SetLink from this project.

Unless you'd prefer I also rename those other ones?

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