-
Notifications
You must be signed in to change notification settings - Fork 438
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 slot chain mechanism and introduce slot order to rank #318
Conversation
Some suggestion about default order of embedded slot.
|
Codecov Report
@@ Coverage Diff @@
## master #318 +/- ##
==========================================
+ Coverage 50.36% 50.39% +0.02%
==========================================
Files 68 68
Lines 3709 3717 +8
==========================================
+ Hits 1868 1873 +5
- Misses 1578 1582 +4
+ Partials 263 262 -1
Continue to review full report at Codecov.
|
Agree. Refined. |
@liqiangz @sanxun0325 Could you please take a look on this PR ? |
@@ -5,7 +5,8 @@ import ( | |||
) | |||
|
|||
const ( | |||
RuleCheckSlotName = "sentinel-core-circuit-breaker-rule-check-slot" | |||
RuleCheckSlotName = "sentinel-core-circuit-breaker-rule-check-slot" | |||
RuleCheckSlotOrder = 5000 |
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.
It is better to define the order of slots in a uniform location, which may seem more intuitive。
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.
My first version is like what you recommended, current version is the result of discussion with @louyuting .
@@ -5,7 +5,8 @@ import ( | |||
) | |||
|
|||
const ( | |||
PrepareSlotName = "sentinel-core-stat-resource-node-prepare-slot" | |||
PrepareSlotName = "sentinel-core-stat-resource-node-prepare-slot" | |||
PrepareSlotOrder = 1000 |
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.
Does the definition of a slot order, starting at 1000, have any particular meaning?
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.
Leave a gap for the user to add extended slots before it.
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.
Leave a gap for the user to add extended slots before it.
Yes,The main thing I'm trying to say is the order of slots 1000, why isn't it 2000, or 10000.There should be a specification for it. I don't know if there are any other better ideas for defining the slot order that Sentinel provides by default。
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
Describe what this PR does / why we need it
Support slot order.
Slots in a slot chain are sorted by order value of slots in increasing order. Default slot chain has a fixed default order and have no relation to the add sequence. User extended slot can set the order to make it be in front of or at the back of a sentinel build-in slot easily.
Does this pull request fix one issue?
#317
Describe how you did it
Describe how to verify it
Special notes for reviews