类 SystemRule
- 所有已实现的接口:
Rule
Sentinel System Rule makes the inbound traffic and capacity meet. It takes average RT, QPS and thread count of requests into account. And it also provides a measurement of system's load, but only available on Linux.
We recommend to coordinate highestSystemLoad, qps, avgRt
and maxThread to make sure your system run in safety level.
To set the threshold appropriately, performance test may be needed.
- 作者:
- jialiang.linjl, Carpenter Lee
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明booleanlonggetAvgRt()doubleGet highest cpu usage.doublelongdoublegetQps()inthashCode()voidsetAvgRt(long avgRt) Set max average RT(response time) of all passed requests.voidsetHighestCpuUsage(double highestCpuUsage) set highest cpu usage.voidsetHighestSystemLoad(double highestSystemLoad) Set highest load.voidsetMaxThread(long maxThread) Set max PARALLEL working thread.voidsetQps(double qps) Set max total QPS.toString()从类继承的方法 com.alibaba.csp.sentinel.slots.block.AbstractRule
as, getId, getLimitApp, getResource, isRegex, setId, setLimitApp, setRegex, setResource
-
构造器详细资料
-
SystemRule
public SystemRule()
-
-
方法详细资料
-
getQps
public double getQps() -
setQps
public void setQps(double qps) Set max total QPS. In a high concurrency condition, real passed QPS may be greater than max QPS set. The real passed QPS will nearly satisfy the following formula:
real passed QPS = QPS set + concurrent thread number
- 参数:
qps- max total QOS, values <= 0 are special for clearing the threshold.
-
getMaxThread
public long getMaxThread() -
setMaxThread
public void setMaxThread(long maxThread) Set max PARALLEL working thread. When concurrent thread number is greater thanmaxThreadonly maxThread will run in parallel.- 参数:
maxThread- max parallel thread number, values <= 0 are special for clearing the threshold.
-
getAvgRt
public long getAvgRt() -
setAvgRt
public void setAvgRt(long avgRt) Set max average RT(response time) of all passed requests.- 参数:
avgRt- max average response time, values <= 0 are special for clearing the threshold.
-
getHighestSystemLoad
public double getHighestSystemLoad() -
setHighestSystemLoad
public void setHighestSystemLoad(double highestSystemLoad) Set highest load. The load is not same as Linux system load, which is not sensitive enough. To calculate the load, both Linux system load, current global response time and global QPS will be considered, which means that we need to coordinate with
setAvgRt(long)andsetQps(double)Note that this parameter is only available on Unix like system.
- 参数:
highestSystemLoad- highest system load, values <= 0 are special for clearing the threshold.- 另请参阅:
-
getHighestCpuUsage
public double getHighestCpuUsage()Get highest cpu usage. Cpu usage is between [0, 1]- 返回:
- highest cpu usage
-
setHighestCpuUsage
public void setHighestCpuUsage(double highestCpuUsage) set highest cpu usage. Cpu usage is between [0, 1]- 参数:
highestCpuUsage- the value to set.
-
equals
- 覆盖:
equals在类中AbstractRule
-
hashCode
public int hashCode()- 覆盖:
hashCode在类中AbstractRule
-
toString
-