-
Notifications
You must be signed in to change notification settings - Fork 8k
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
[Feature] Add CPU usage checking support in system protection rule #484
Conversation
Signed-off-by: Carpenter Lee <hooleeucas@163.com>
As the |
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.
|
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! |
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.