-
Notifications
You must be signed in to change notification settings - Fork 8k
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
Add occupy mechanism for future buckets of sliding window to support "prioritized requests" #568
Conversation
- Update test cases - Also add `totalPass` method in Node interface Signed-off-by: Eric Zhao <[email protected]>
- Also fix for test cases Signed-off-by: Eric Zhao <[email protected]>
Signed-off-by: Eric Zhao <[email protected]>
Signed-off-by: Eric Zhao <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #568 +/- ##
============================================
- Coverage 38.73% 38.63% -0.11%
- Complexity 1186 1213 +27
============================================
Files 271 275 +4
Lines 8488 8674 +186
Branches 1133 1159 +26
============================================
+ Hits 3288 3351 +63
- Misses 4785 4906 +121
- Partials 415 417 +2
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #568 +/- ##
============================================
+ Coverage 39.09% 39.12% +0.03%
- Complexity 1196 1225 +29
============================================
Files 271 275 +4
Lines 8494 8674 +180
Branches 1134 1159 +25
============================================
+ Hits 3321 3394 +73
- Misses 4754 4853 +99
- Partials 419 427 +8
Continue to review full report at Codecov.
|
Signed-off-by: Eric Zhao <[email protected]>
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
Signed-off-by: Eric Zhao <[email protected]>
Describe what this PR does / why we need it
Add occupy mechanism for future buckets of sliding window to support "prioritized requests".
Does this pull request fix one issue?
Related to #207
Describe how you did it
MetricsLeapArray
->BucketLeapArray
FutureBucketLeapArray
, a kind ofBucketLeapArray
that only reserves for future buckets, which is used for calculating occupied future tokens.OccupiableBucketLeapArray
that combines commonBucketLeapArray
withFutureBucketLeapArray
. TherollingNumberInSecond
inStatisticNode
now usesOccupiableBucketLeapArray
by default.OccupySupport
interface.Node
now implementsOccupySupport
interface.Metric
andArrayMetric
.Describe how to verify it
Run the test case and demo.
Special notes for reviews
This PR contains breaking changes, please consider it carefully.