Skip to content

Improve the checking logic of SystemRule and enhance SystemRuleManager - #1050

Merged
sczyh30 merged 1 commit into
alibaba:masterfrom
sczyh30:improve/sys-rule-190918
Sep 19, 2019
Merged

Improve the checking logic of SystemRule and enhance SystemRuleManager#1050
sczyh30 merged 1 commit into
alibaba:masterfrom
sczyh30:improve/sys-rule-190918

Conversation

@sczyh30

@sczyh30 sczyh30 commented Sep 18, 2019

Copy link
Copy Markdown
Member

Describe what this PR does / why we need it

Improve SystemRuleManager and refactor the checking logic of maxCpuUsage strategy in SystemRule.

Does this pull request fix one issue?

NONE

Describe how you did it

  • The BBR period for maxCpuUsage strategy is deprecated. Now Sentinel will just check the CPU usage value, which could avert surge of CPU usage quickly.
  • Improve SystemRuleManager and SystemStatusListener.
  • Add some test cases.

Describe how to verify it

Run the test cases.

Special notes for reviews

NONE

…strategy

- The BBR period for maxCpuUsage strategy is deprecated
- Improve code of SystemRuleManager and SystemStatusListener
- Add test cases

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
@sczyh30 sczyh30 added kind/enhancement Category issues or prs related to enhancement. to-review To review labels Sep 18, 2019
@sczyh30 sczyh30 added this to the 1.7.0 milestone Sep 18, 2019
@codecov-io

Copy link
Copy Markdown

Codecov Report

Merging #1050 into master will increase coverage by 0.44%.
The diff coverage is 29.62%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1050      +/-   ##
============================================
+ Coverage     42.64%   43.08%   +0.44%     
- Complexity     1472     1493      +21     
============================================
  Files           317      317              
  Lines          9286     9290       +4     
  Branches       1267     1268       +1     
============================================
+ Hits           3960     4003      +43     
+ Misses         4833     4795      -38     
+ Partials        493      492       -1
Impacted Files Coverage Δ Complexity Δ
...sp/sentinel/slots/system/SystemStatusListener.java 37.03% <0%> (-4.63%) 3 <0> (+1)
...a/csp/sentinel/slots/system/SystemRuleManager.java 65% <66.66%> (+21.83%) 19 <2> (+12) ⬆️
...tinel/slots/block/flow/param/ParamFlowChecker.java 53.37% <0%> (-2.03%) 29% <0%> (ø)
...p/sentinel/datasource/consul/ConsulDataSource.java 63.76% <0%> (-1.45%) 7% <0%> (ø)
...a/csp/sentinel/slots/statistic/base/LeapArray.java 70.29% <0%> (+2.97%) 34% <0%> (+1%) ⬆️
...ava/com/alibaba/csp/sentinel/node/ClusterNode.java 100% <0%> (+4.76%) 8% <0%> (+1%) ⬆️
.../alibaba/csp/sentinel/slots/system/SystemRule.java 44.89% <0%> (+16.32%) 12% <0%> (+4%) ⬆️
...sp/sentinel/slots/system/SystemBlockException.java 44.44% <0%> (+44.44%) 2% <0%> (+2%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4d9a5ef...459498c. Read the comment docs.

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

@sczyh30
sczyh30 merged commit 8b40981 into alibaba:master Sep 19, 2019
@sczyh30 sczyh30 removed the to-review To review label Sep 19, 2019
@sczyh30
sczyh30 deleted the improve/sys-rule-190918 branch September 19, 2019 08:36
@fangwentong

Copy link
Copy Markdown
Contributor

The BBR period for maxCpuUsage strategy is deprecated. Now Sentinel will just check the CPU usage value, which could avert surge of CPU usage quickly.

CPU usage value updates every seconds, this change means that if CPU usage exceed threshold, all the traffic in next second will be blocked?

hughpearse pushed a commit to hughpearse/Sentinel that referenced this pull request Jun 2, 2021
…strategy (alibaba#1050)

- The BBR period for maxCpuUsage strategy is deprecated. Now Sentinel will just check the CPU usage value, which could avert surge of CPU usage quickly
- Improve SystemRuleManager and SystemStatusListener
- Add some test cases

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement Category issues or prs related to enhancement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants