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

Improvements for labels handling #16172

Merged
merged 2 commits into from Oct 18, 2023
Merged

Conversation

stelfrag
Copy link
Collaborator

Summary
  • Adds more tests in various functions
  • Handle attempt to add duplicate label more efficiently
  • Add unit test for duplicate label check and labels migration

rrdlabels_find_label_with_key_unsafe finds a label with specified key (not only if it exists but with difefrent value)
Quick check if label already exists (avoids JudyLIns)
Add additional unit test to verify that adding a label with the same key will replace its value
Copy link
Contributor

@thiagoftsm thiagoftsm left a comment

Choose a reason for hiding this comment

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

PR is working as expected, LGTM!

@thiagoftsm
Copy link
Contributor

@stelfrag you already have enough approves to merge, but Codacy is suggesting changes, please, take a look on it.

@stelfrag stelfrag merged commit 0542661 into netdata:master Oct 18, 2023
148 of 149 checks passed
@stelfrag stelfrag deleted the labels_unit_test branch October 18, 2023 12:46
stelfrag added a commit to stelfrag/netdata that referenced this pull request Oct 25, 2023
* Add additional checks
rrdlabels_find_label_with_key_unsafe finds a label with specified key (not only if it exists but with difefrent value)
Quick check if label already exists (avoids JudyLIns)

* Add migration unit test
Add additional unit test to verify that adding a label with the same key will replace its value

(cherry picked from commit 0542661)
@stelfrag stelfrag mentioned this pull request Oct 25, 2023
tkatsoulas pushed a commit that referenced this pull request Oct 26, 2023
* Add additional checks
rrdlabels_find_label_with_key_unsafe finds a label with specified key (not only if it exists but with difefrent value)
Quick check if label already exists (avoids JudyLIns)

* Add migration unit test
Add additional unit test to verify that adding a label with the same key will replace its value

(cherry picked from commit 0542661)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants