Skip to content

[RFC] Changing statistic time window in degrade rule dynamically #308

@CarpenterLee

Description

@CarpenterLee

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/circuit-breakingIssues or PRs related to circuit breakingarea/metricsIssues or PRs related to metrics and monitoringkind/featureCategory issues or prs related to feature request.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions