Add dead zone ratio to PID controller for noise suppression#1032
Open
Abuudiii wants to merge 2 commits intopid-take-2from
Open
Add dead zone ratio to PID controller for noise suppression#1032Abuudiii wants to merge 2 commits intopid-take-2from
Abuudiii wants to merge 2 commits intopid-take-2from
Conversation
- Introduced `dead_zone_ratio` parameter in the PID controller to suppress noise from small deviations in error rates. - Updated the `calculate_p_value` method to implement dead zone logic, allowing for more stable control responses. - Enhanced tests to validate the behavior of the dead zone in various scenarios, ensuring it does not impede recovery while effectively filtering noise.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
closes https://github.com/Shopify/resiliency/issues/6664
Summary
ideal_error_rate * dead_zone_ratioof the ideal are treated as zero deviation, preventing unnecessary rejection rate increasesHow it works
The dead zone defines a band around the ideal error rate where the controller ignores noise:
0 < delta <= ideal * ratio): delta suppressed to 0delta > ideal * ratio): controller reacts to the excess (delta - dead_zone)Example: with
initial_error_rate: 0.05anddead_zone_ratio: 0.25, error rates up to 6.25% won't trigger rejection.Files changed
lib/semian/pid_controller.rb— dead zone logic incalculate_p_valuelib/semian/adaptive_circuit_breaker.rb— passesdead_zone_ratioto PID controllerlib/semian.rb— wiresdead_zone_ratio: 0.25default in factory methodtest/pid_controller_test.rb— tests for suppression, reaction above threshold, and unimpeded recovery