[Feature] Add CPU usage checking support in system protection rule#484
Merged
[Feature] Add CPU usage checking support in system protection rule#484
Conversation
Signed-off-by: Carpenter Lee <hooleeucas@163.com>
Member
|
As the |
sczyh30
reviewed
Mar 6, 2019
sentinel-core/src/main/java/com/alibaba/csp/sentinel/slots/system/SystemRuleManager.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Carpenter Lee <hooleeucas@163.com>
57631a2 to
20706b8
Compare
Codecov Report
@@ Coverage Diff @@
## master #484 +/- ##
===========================================
+ Coverage 37.96% 38.6% +0.64%
- Complexity 1111 1160 +49
===========================================
Files 259 259
Lines 8177 8385 +208
Branches 1115 1176 +61
===========================================
+ Hits 3104 3237 +133
- Misses 4668 4737 +69
- Partials 405 411 +6
Continue to review full report at Codecov.
|
Member
|
Thanks! |
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.
Describe what this PR does / why we need it
Sentinel System Guard takes average RT, QPS, thread count and system load into account, but does not consider CPU usage. Comparing to system load, CPU usage is more sensitive, which is useful when vast requests coming in sudden.
Does this pull request fix one issue?
Resolves #450
Describe how you did it
Add CPU usage threshold into system rule, and when current CPU usage reaches the threshold, a BBR likely checking will be done.
Describe how to verify it
Rule SystemGuardDemo.