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 multiple tokens per request entry #380

Merged
merged 1 commit into from
Jan 4, 2019

Conversation

sczyh30
Copy link
Member

@sczyh30 sczyh30 commented Jan 4, 2019

Describe what this PR does / why we need it

In Sentinel API SphU.entry(resourceName, entryType, acquireCount, args) we can pass different acquireCount to acquire multiple counts for the request entry. But the internal StatisticSlot does not take the exact count, which may cause problems. So we need to support multiple tokens per request entry in internal classes (Node, Metric and StatisticSlot).

Does this pull request fix one issue?

Fixes #337

Describe how you did it

  • Refactor MetricBucket to support add multiple count (addCount(event, n))
  • Refactor Node and Metric related classes
  • Refactor for StatisticSlot

Describe how to verify it

See test cases.

Special notes for reviews

NONE

- Refactor MetricBucket to support add multiple count
- Refactor Node and Metric related classes
- Refactor for StatisticSlot

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
@sczyh30 sczyh30 added the to-review To review label Jan 4, 2019
@sczyh30 sczyh30 added this to the 1.4.1 milestone Jan 4, 2019
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 9165fe0 into master Jan 4, 2019
@sczyh30 sczyh30 removed the to-review To review label Jan 4, 2019
@sczyh30 sczyh30 deleted the fix/entry-multiple-tokens branch January 4, 2019 05:02
Arlmls pushed a commit to Arlmls/Sentinel that referenced this pull request Jan 8, 2019
- Refactor MetricBucket to support add multiple count
- Refactor Node and Metric related classes
- Refactor for StatisticSlot

Signed-off-by: Eric Zhao <sczyh16@gmail.com>
CST11021 pushed a commit to CST11021/Sentinel that referenced this pull request Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support multiple tokens per request
2 participants