GeezerVison is showing github.com — Properly handle the adaptive sampling interval overflow by jbachorik · Pull Request #213 · DataDog/java-profiler
Conversation
jbachorik
commented
May 20, 2025
•
edited by atlassian
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
What does this PR do?:
It adds safety handling for possible sampling interval overflows
Motivation:
The adaptive sampling interval can overflow int range when a very allocation heavy activity is present - and wrap back to the default value which is terrible for the profile size.
It is much better to just clamp on INT_MAX - yes, we will miss the rate target but not that brutally as when wrapping around to the default interval.
For Datadog employees:
- If this PR touches code that signs or publishes builds or packages, or handles
credentials of any kind, I've requested a review from @DataDog/security-design-and-guidance.
- This PR doesn't touch any of that.
- JIRA: PROF-11801
Unsure? Have a question? Request a review!
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
🔧 Report generated by pr-comment-cppcheck
CppCheck ReportErrors (2)
Warnings (4)
Style Violations (295)
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
🔧 Report generated by pr-comment-scanbuild
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
|
@@ -188,14 +189,16 @@ Error ObjectSampler::updateConfiguration(u64 events, double time_coefficient) { |
|
|
CONFIG_UPDATE_CHECK_PERIOD_SECS, 15);
|
|
|
|
|
|
float signal = pid_controller.compute(events, time_coefficient);
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor, there is already a conversion here from double to float. Then a truncation to an int.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for thinking carefully about this!
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
jbachorik reacted with thumbs up emoji
Reviewers
zhengyu123
Awaiting requested review from zhengyu123
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|