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

Expand more statistic dimensions( such as 20s, 1min, 20min), not only for 1 second | 流控规则支持自定义统计时长 #263

Open
ro9er opened this issue Nov 26, 2018 · 2 comments
Labels
area/flow-control Issues or PRs related to flow control kind/feature Category issues or prs related to feature request.
Milestone

Comments

@ro9er
Copy link
Contributor

ro9er commented Nov 26, 2018

Issue Description

feature request

Describe what happened (or what feature you want)

In some situation, we want to perform flow control not only based on the statistics of 1 second. For example, as for some origin/callers, we wanna count the call times in 1 minute and block the caller if the count exceeds the threshold. Sentinel does not support this kind of statistics.

Describe what you expected to happen

Sentinel supports more statistic dimension of unit. It would be perfect if programmers can build the statistic rule by setting count parameters.

How to reproduce it (as minimally and precisely as possible)

Tell us your environment

Anything else we need to know?

@sczyh30 sczyh30 added kind/enhancement Category issues or prs related to enhancement. kind/feature Category issues or prs related to feature request. and removed kind/enhancement Category issues or prs related to enhancement. labels Nov 26, 2018
@sczyh30
Copy link
Member

sczyh30 commented Nov 27, 2018

This is a good idea giving users more flexible strategy. Any thoughts on its implementation?

@ro9er
Copy link
Contributor Author

ro9er commented Dec 3, 2018

Maybe one way to implement that is make one resource contains N clusterNode, which correspond to one time dimension rule. For example, if one resource has 4 rules and the statistic unit is 1s 1s 20s 20min, the resource will have 3 cluster Node. And we perform flow control on that.
Another way is that we use just one clusterNode based on 1s like now. And if we want to support more statistic dimension, we log the statistic per second by retrieving the clusternode per second or on requests entering.

@sczyh30 sczyh30 changed the title Expand more statistic dimensions( such as 20s, 1min, 20min), not only for 1 second Expand more statistic dimensions( such as 20s, 1min, 20min), not only for 1 second | 流控规则支持自定义统计时长 Nov 14, 2022
@sczyh30 sczyh30 added the area/flow-control Issues or PRs related to flow control label Nov 14, 2022
@sczyh30 sczyh30 added this to the v2.0.0 milestone Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/flow-control Issues or PRs related to flow control kind/feature Category issues or prs related to feature request.
Projects
None yet
Development

No branches or pull requests

2 participants