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

Refactor flow algorithm for parameter flow control and support more traffic shaping mode #677

Merged
merged 9 commits into from
Apr 22, 2019

Conversation

sczyh30
Copy link
Member

@sczyh30 sczyh30 commented Apr 17, 2019

Describe what this PR does / why we need it

Refactor flow algorithm for parameter flow control and support more traffic shaping mode.

Does this pull request fix one issue?

Resolves #640

Describe how you did it

  • Add fields in ParamFlowRule to support burst count, throttle, statistic interval per rule.
  • Deprecate HotParamLeapArray and use token bucket algorithm directly.

Some of the code should be rearranged and improved.

Describe how to verify it

Run the test cases and demo.

Special notes for reviews

This PR contains breaking changes. Please take it carefully.

jialianglinjl and others added 4 commits April 17, 2019 15:44
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
@sczyh30 sczyh30 added to-review To review size/XXL Indicate a PR that changes 1000+ lines. labels Apr 17, 2019
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
@codecov-io
Copy link

codecov-io commented Apr 19, 2019

Codecov Report

Merging #677 into master will increase coverage by 0.82%.
The diff coverage is 66.88%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #677      +/-   ##
============================================
+ Coverage     40.83%   41.65%   +0.82%     
- Complexity     1220     1249      +29     
============================================
  Files           267      266       -1     
  Lines          7920     7992      +72     
  Branches       1076     1103      +27     
============================================
+ Hits           3234     3329      +95     
+ Misses         4290     4247      -43     
- Partials        396      416      +20
Impacted Files Coverage Δ Complexity Δ
...ots/statistic/ParamFlowStatisticEntryCallback.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...nd/handler/ModifyParamFlowRulesCommandHandler.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...mmand/handler/GetParamFlowRulesCommandHandler.java 0% <ø> (ø) 0 <0> (ø) ⬇️
...l/slots/block/flow/param/ParamFlowRuleManager.java 75% <ø> (ø) 7 <0> (ø) ⬇️
...inel/slots/block/flow/param/ParamFlowRuleUtil.java 50.87% <0%> (-2.83%) 20 <0> (ø)
...sentinel/slots/block/flow/param/ParamFlowSlot.java 81.35% <100%> (+0.1%) 21 <0> (-1) ⬇️
...tinel/slots/block/flow/param/ParamFlowChecker.java 53.02% <63.41%> (+6.26%) 28 <12> (+9) ⬆️
...sentinel/slots/block/flow/param/ParamFlowRule.java 71.05% <70.96%> (+8.08%) 27 <7> (+8) ⬆️
...ntinel/slots/block/flow/param/ParameterMetric.java 75% <77.14%> (+23.63%) 29 <10> (+1) ⬆️
.../slots/statistic/metric/HotParameterLeapArray.java 78.04% <0%> (-7.32%) 10% <0%> (-2%)
... and 2 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 08611fa...20341ff. Read the comment docs.

sczyh30 added 4 commits April 19, 2019 16:32
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
Copy link
Contributor

@CarpenterLee CarpenterLee left a comment

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 e9719d3 into master Apr 22, 2019
@sczyh30 sczyh30 removed the to-review To review label Apr 22, 2019
@sczyh30 sczyh30 added this to the 1.6.0 milestone Apr 22, 2019
@sczyh30 sczyh30 deleted the refactor/param-multiple-control branch April 22, 2019 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XXL Indicate a PR that changes 1000+ lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add uniform rate limiting mode in parameter flow control
4 participants