Skip to content
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

Support setting global rule #956

Closed
wants to merge 36 commits into from
Closed

Support setting global rule #956

wants to merge 36 commits into from

Conversation

linlinisme
Copy link
Collaborator

@linlinisme linlinisme commented Aug 1, 2019

Does this pull request fix one issue?

Fix: #66

Describe how you did it

  1. Global rules support both flow and degrade.
  2. The flow and degrade global rules have one and only one rule.
  3. Global rules are created with specific resources
  4. GlobalManger manages them: create, store, update, and retrieve.
  5. When the resource performs flow and degrade check, it will get the rule check through GlobalManager in real time.
  6. Global rules and resource rules themselves are superimposed on each other. The resource itself is checked first, and the final check is the global rule.

Describe how to verify it

  Run test cases I offer

Special notes for reviews

 None

Lin.Liang and others added 30 commits May 9, 2019 14:54
using the LongAdder rather than AtomicInteger to Provides better performance
@codecov-io
Copy link

codecov-io commented Aug 1, 2019

Codecov Report

Merging #956 into master will increase coverage by 0.84%.
The diff coverage is 74.46%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #956      +/-   ##
============================================
+ Coverage     42.61%   43.45%   +0.84%     
- Complexity     1442     1476      +34     
============================================
  Files           310      313       +3     
  Lines          8985     9055      +70     
  Branches       1222     1237      +15     
============================================
+ Hits           3829     3935     +106     
+ Misses         4687     4639      -48     
- Partials        469      481      +12
Impacted Files Coverage Δ Complexity Δ
...sp/sentinel/slots/block/global/GlobalRuleType.java 100% <100%> (ø) 1 <1> (?)
...csp/sentinel/slots/block/flow/FlowRuleChecker.java 52.5% <100%> (+2.5%) 24 <0> (+3) ⬆️
.../csp/sentinel/slots/block/degrade/DegradeRule.java 88.46% <100%> (+16.66%) 27 <0> (+3) ⬆️
...om/alibaba/csp/sentinel/config/SentinelConfig.java 58.9% <100%> (+1.15%) 14 <0> (ø) ⬇️
.../sentinel/slots/block/global/GlobalRuleConfig.java 50% <50%> (ø) 1 <1> (?)
...sentinel/slots/block/global/GlobalRuleManager.java 71.42% <71.42%> (ø) 5 <5> (?)
...ntinel/slots/block/degrade/DegradeRuleManager.java 49.49% <73.07%> (+27.61%) 21 <10> (+12) ⬆️
...ava/com/alibaba/csp/sentinel/node/ClusterNode.java 95.23% <0%> (-4.77%) 7% <0%> (-1%)
.../slots/block/flow/controller/WarmUpController.java 78.84% <0%> (-3.85%) 10% <0%> (-1%)
...a/csp/sentinel/slots/statistic/base/LeapArray.java 70.29% <0%> (ø) 34% <0%> (ø) ⬇️
... and 11 more

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 88b5631...5c094aa. Read the comment docs.

@sczyh30 sczyh30 added kind/feature Category issues or prs related to feature request. to-review To review labels Aug 1, 2019
@sczyh30
Copy link
Member

sczyh30 commented Aug 2, 2019

👍 I'll take a look these days :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Category issues or prs related to feature request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Support setting the universal default rule for all resources
3 participants