类 DegradeRule
java.lang.Object
com.alibaba.csp.sentinel.slots.block.AbstractRule
com.alibaba.csp.sentinel.slots.block.degrade.DegradeRule
- 所有已实现的接口:
Rule
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:
-
Average response time (
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. - Exception ratio: When the ratio of exception count per second and the success qps exceeds the threshold, access to the resource will be blocked in the coming window.
- 作者:
- jialiang.linjl, Eric Zhao
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明booleandoublegetCount()intgetGrade()intdoubleintintinthashCode()setCount(double count) setGrade(int grade) setMinRequestAmount(int minRequestAmount) setSlowRatioThreshold(double slowRatioThreshold) setStatIntervalMs(int statIntervalMs) setTimeWindow(int timeWindow) toString()从类继承的方法 com.alibaba.csp.sentinel.slots.block.AbstractRule
as, getId, getLimitApp, getResource, isRegex, setId, setLimitApp, setRegex, setResource
-
构造器详细资料
-
DegradeRule
public DegradeRule() -
DegradeRule
-
-
方法详细资料
-
getGrade
public int getGrade() -
setGrade
-
getCount
public double getCount() -
setCount
-
getTimeWindow
public int getTimeWindow() -
setTimeWindow
-
getMinRequestAmount
public int getMinRequestAmount() -
setMinRequestAmount
-
getSlowRatioThreshold
public double getSlowRatioThreshold() -
setSlowRatioThreshold
-
getStatIntervalMs
public int getStatIntervalMs() -
setStatIntervalMs
-
equals
- 覆盖:
equals在类中AbstractRule
-
hashCode
public int hashCode()- 覆盖:
hashCode在类中AbstractRule
-
toString
-