public class DegradeRule extends AbstractRule
Degrade is used when the resources are in an unstable state, these resources will be degraded within the next defined time window. There are two ways to measure whether a resource is stable or not:
DEGRADE_GRADE_RT): When
the average RT exceeds the threshold ('count' in 'DegradeRule', in milliseconds), the
resource enters a quasi-degraded state. If the RT of next coming 5
requests still exceed this threshold, this resource will be downgraded, which
means that in the next time window (defined in 'timeWindow', in seconds) all the
access to this resource will be blocked.
| Constructor and Description |
|---|
DegradeRule() |
DegradeRule(String resourceName) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
double |
getCount() |
int |
getGrade() |
int |
getMinRequestAmount() |
double |
getSlowRatioThreshold() |
int |
getStatIntervalMs() |
int |
getTimeWindow() |
int |
hashCode() |
DegradeRule |
setCount(double count) |
DegradeRule |
setGrade(int grade) |
DegradeRule |
setMinRequestAmount(int minRequestAmount) |
DegradeRule |
setSlowRatioThreshold(double slowRatioThreshold) |
DegradeRule |
setStatIntervalMs(int statIntervalMs) |
DegradeRule |
setTimeWindow(int timeWindow) |
String |
toString() |
as, getLimitApp, getResource, setLimitApp, setResourcepublic DegradeRule()
public DegradeRule(String resourceName)
public int getGrade()
public DegradeRule setGrade(int grade)
public double getCount()
public DegradeRule setCount(double count)
public int getTimeWindow()
public DegradeRule setTimeWindow(int timeWindow)
public int getMinRequestAmount()
public DegradeRule setMinRequestAmount(int minRequestAmount)
public double getSlowRatioThreshold()
public DegradeRule setSlowRatioThreshold(double slowRatioThreshold)
public int getStatIntervalMs()
public DegradeRule setStatIntervalMs(int statIntervalMs)
public boolean equals(Object o)
equals in class AbstractRulepublic int hashCode()
hashCode in class AbstractRuleCopyright © 2021 Alibaba Group. All rights reserved.