-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Description
Issue Description
Type: feature request
Describe what feature you want
Now Sentinel uses sliding window algorithm to statistic metrics, and time window is globally the same, which is usually 1 or 2 seconds. This time window fits well for the flow controlling and shaping, because flow controlling primary based on QPS, a short time window means more sensitive.
But as for degradation(Circuit Breaking), multi statistic time interval is needed, since degradation is based on average RT, and exception count or exception ratio, 1 or 2 seconds may be too short in low traffic.
Describe what you expected to happen
Changing time window in degrade rule dynamically.
The main challenge to set time window interval dynamically for each degrade rule is that flow rule and degrade rule use the same statistic node, changing the interval will lead interaction effect.
One solution is to use different statistic node for flow rule and degrade rule. Current statistic structure is use for flow controlling only, and creating new statistic node for degrade rule, every time the time interval is changed, statistic node will be recreated. The statistic nodes for degrade rule are created lazily.