Skip to content

Support multiple tokens per request entry - #380

Merged
sczyh30 merged 1 commit into
masterfrom
fix/entry-multiple-tokens
Jan 4, 2019
Merged

Support multiple tokens per request entry#380
sczyh30 merged 1 commit into
masterfrom
fix/entry-multiple-tokens

Conversation

@sczyh30

@sczyh30 sczyh30 commented Jan 4, 2019

Copy link
Copy Markdown
Member

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

@CarpenterLee CarpenterLee left a comment

Copy link
Copy Markdown
Contributor

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