java.lang.Object
com.alibaba.csp.sentinel.cluster.flow.statistic.metric.ClusterMetric

public class ClusterMetric extends Object
从以下版本开始:
1.4.0
作者:
Eric Zhao
  • 构造器详细资料

    • ClusterMetric

      public ClusterMetric(int sampleCount, int intervalInMs)
  • 方法详细资料

    • add

      public void add(ClusterFlowEvent event, long count)
    • getCurrentCount

      public long getCurrentCount(ClusterFlowEvent event)
    • getSum

      public long getSum(ClusterFlowEvent event)
      Get total sum for provided event in intervalInSec.
      参数:
      event - event to calculate
      返回:
      total sum for event
    • getAvg

      public double getAvg(ClusterFlowEvent event)
      Get average count for provided event per second.
      参数:
      event - event to calculate
      返回:
      average count per second for event
    • tryOccupyNext

      public int tryOccupyNext(ClusterFlowEvent event, int acquireCount, double threshold)
      Try to pre-occupy upcoming buckets.
      返回:
      time to wait for next bucket (in ms); 0 if cannot occupy next buckets