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

Allow negative paramIndex in ParamFlowRule #549

Merged
merged 2 commits into from
Mar 6, 2019

Conversation

CarpenterLee
Copy link
Contributor

Signed-off-by: Carpenter Lee hooleeucas@163.com

Describe what this PR does / why we need it

Negative paramIndex in ParamFlowRule is useful in some case, eg when we want to count params from the opposite direction. But Sentinel does not allow negative paramIndex in ParamFlowRule now.

Does this pull request fix one issue?

NONE

Describe how you did it

Change ParamFlowRuleUtil and ParamFlowChecker to allow negative paramIndex in ParamFlowRule

Describe how to verify it

Run unit test cases

Special notes for reviews

Signed-off-by: Carpenter Lee <hooleeucas@163.com>
Signed-off-by: Carpenter Lee <hooleeucas@163.com>
@codecov-io
Copy link

Codecov Report

Merging #549 into master will increase coverage by 0.51%.
The diff coverage is 55.55%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #549      +/-   ##
============================================
+ Coverage     37.51%   38.02%   +0.51%     
- Complexity     1102     1112      +10     
============================================
  Files           259      259              
  Lines          8171     8177       +6     
  Branches       1113     1115       +2     
============================================
+ Hits           3065     3109      +44     
+ Misses         4715     4664      -51     
- Partials        391      404      +13
Impacted Files Coverage Δ Complexity Δ
...inel/slots/block/flow/param/ParamFlowRuleUtil.java 53.7% <0%> (ø) 20 <0> (-1) ⬇️
...tinel/slots/block/flow/param/ParamFlowChecker.java 46.98% <62.5%> (+0.23%) 20 <1> (+1) ⬆️
...l/cluster/server/connection/ConnectionManager.java 74% <0%> (-2%) 10% <0%> (-1%)
...a/com/alibaba/csp/sentinel/node/StatisticNode.java 81.96% <0%> (-1.64%) 28% <0%> (-1%)
...a/csp/sentinel/slots/statistic/base/LeapArray.java 69.62% <0%> (+3.79%) 25% <0%> (+1%) ⬆️
...a/csp/sentinel/slots/statistic/base/LongAdder.java 31.91% <0%> (+14.89%) 10% <0%> (+6%) ⬆️
...a/csp/sentinel/slots/statistic/base/Striped64.java 60.41% <0%> (+34.37%) 10% <0%> (+5%) ⬆️

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 d05a603...6f2fdc2. Read the comment docs.

Copy link
Member

@sczyh30 sczyh30 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 80797ae into master Mar 6, 2019
@sczyh30 sczyh30 added this to the 1.5.0 milestone Mar 6, 2019
@sczyh30 sczyh30 added the kind/enhancement Category issues or prs related to enhancement. label Mar 6, 2019
@sczyh30
Copy link
Member

sczyh30 commented Mar 6, 2019

Thanks!

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