类 ClusterMetric
java.lang.Object
com.alibaba.csp.sentinel.cluster.flow.statistic.metric.ClusterMetric
- 从以下版本开始:
- 1.4.0
- 作者:
- Eric Zhao
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidadd(ClusterFlowEvent event, long count) doublegetAvg(ClusterFlowEvent event) Get average count for provided event per second.longgetCurrentCount(ClusterFlowEvent event) longgetSum(ClusterFlowEvent event) Get total sum for provided event inintervalInSec.inttryOccupyNext(ClusterFlowEvent event, int acquireCount, double threshold) Try to pre-occupy upcoming buckets.
-
构造器详细资料
-
ClusterMetric
public ClusterMetric(int sampleCount, int intervalInMs)
-
-
方法详细资料
-
add
-
getCurrentCount
-
getSum
Get total sum for provided event inintervalInSec.- 参数:
event- event to calculate- 返回:
- total sum for event
-
getAvg
Get average count for provided event per second.- 参数:
event- event to calculate- 返回:
- average count per second for event
-
tryOccupyNext
Try to pre-occupy upcoming buckets.- 返回:
- time to wait for next bucket (in ms); 0 if cannot occupy next buckets
-