java.lang.Object
com.alibaba.csp.sentinel.slots.statistic.metric.ArrayMetric
所有已实现的接口:
DebugSupport, Metric

public class ArrayMetric extends Object implements Metric
The basic metric class in Sentinel using a BucketLeapArray internal.
作者:
jialiang.linjl, Eric Zhao
  • 构造器详细资料

    • ArrayMetric

      public ArrayMetric(int sampleCount, int intervalInMs)
    • ArrayMetric

      public ArrayMetric(int sampleCount, int intervalInMs, boolean enableOccupy)
    • ArrayMetric

      public ArrayMetric(LeapArray<MetricBucket> array)
      For unit test.
  • 方法详细资料

    • success

      public long success()
      从接口复制的说明: Metric
      Get total success count.
      指定者:
      success 在接口中 Metric
      返回:
      success count
    • maxSuccess

      public long maxSuccess()
      从接口复制的说明: Metric
      Get max success count.
      指定者:
      maxSuccess 在接口中 Metric
      返回:
      max success count
    • exception

      public long exception()
      从接口复制的说明: Metric
      Get total exception count.
      指定者:
      exception 在接口中 Metric
      返回:
      exception count
    • block

      public long block()
      从接口复制的说明: Metric
      Get total block count.
      指定者:
      block 在接口中 Metric
      返回:
      block count
    • pass

      public long pass()
      从接口复制的说明: Metric
      Get total pass count. not include Metric.occupiedPass()
      指定者:
      pass 在接口中 Metric
      返回:
      pass count
    • occupiedPass

      public long occupiedPass()
      从接口复制的说明: Metric
      Get occupied pass count.
      指定者:
      occupiedPass 在接口中 Metric
      返回:
      occupied pass count
    • rt

      public long rt()
      从接口复制的说明: Metric
      Get total response time.
      指定者:
      rt 在接口中 Metric
      返回:
      total RT
    • minRt

      public long minRt()
      从接口复制的说明: Metric
      Get the minimal RT.
      指定者:
      minRt 在接口中 Metric
      返回:
      minimal RT
    • details

      public List<MetricNode> details()
      从接口复制的说明: Metric
      Get aggregated metric nodes of all resources.
      指定者:
      details 在接口中 Metric
      返回:
      metric node list of all resources
    • detailsOnCondition

      public List<MetricNode> detailsOnCondition(Predicate<Long> timePredicate)
      从接口复制的说明: Metric
      Generate aggregated metric items that satisfies the time predicate.
      指定者:
      detailsOnCondition 在接口中 Metric
      参数:
      timePredicate - time predicate
      返回:
      aggregated metric items
    • windows

      public MetricBucket[] windows()
      从接口复制的说明: Metric
      Get the raw window array.
      指定者:
      windows 在接口中 Metric
      返回:
      window metric array
    • addException

      public void addException(int count)
      从接口复制的说明: Metric
      Add current exception count.
      指定者:
      addException 在接口中 Metric
      参数:
      count - count to add
    • addBlock

      public void addBlock(int count)
      从接口复制的说明: Metric
      Add current block count.
      指定者:
      addBlock 在接口中 Metric
      参数:
      count - count to add
    • addWaiting

      public void addWaiting(long time, int acquireCount)
      从接口复制的说明: Metric
      Add request that occupied.
      指定者:
      addWaiting 在接口中 Metric
      参数:
      time - future timestamp that the acquireCount should be added on.
      acquireCount - tokens count.
    • addOccupiedPass

      public void addOccupiedPass(int acquireCount)
      从接口复制的说明: Metric
      Add occupied pass, which represents pass requests that borrow the latter windows' token.
      指定者:
      addOccupiedPass 在接口中 Metric
      参数:
      acquireCount - tokens count.
    • addSuccess

      public void addSuccess(int count)
      从接口复制的说明: Metric
      Add current completed count.
      指定者:
      addSuccess 在接口中 Metric
      参数:
      count - count to add
    • addPass

      public void addPass(int count)
      从接口复制的说明: Metric
      Add current pass count.
      指定者:
      addPass 在接口中 Metric
      参数:
      count - count to add
    • addRT

      public void addRT(long rt)
      从接口复制的说明: Metric
      Add given RT to current total RT.
      指定者:
      addRT 在接口中 Metric
      参数:
      rt - RT
    • debug

      public void debug()
      从接口复制的说明: DebugSupport
      For debug;
      指定者:
      debug 在接口中 DebugSupport
    • previousWindowBlock

      public long previousWindowBlock()
      指定者:
      previousWindowBlock 在接口中 Metric
    • previousWindowPass

      public long previousWindowPass()
      指定者:
      previousWindowPass 在接口中 Metric
    • add

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

      public long getCurrentCount(MetricEvent event)
    • getSum

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

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

      public long getWindowPass(long timeMillis)
      从接口复制的说明: Metric
      Note: this operation will not perform refreshing, so will not generate new buckets.
      指定者:
      getWindowPass 在接口中 Metric
      参数:
      timeMillis - valid time in ms
      返回:
      pass count of the bucket exactly associated to provided timestamp, or 0 if the timestamp is invalid
    • waiting

      public long waiting()
      从接口复制的说明: Metric
      Get waiting pass account
      指定者:
      waiting 在接口中 Metric
      返回:
      waiting pass count
    • getWindowIntervalInSec

      public double getWindowIntervalInSec()
      从接口复制的说明: Metric
      Get the sliding window length in seconds.
      指定者:
      getWindowIntervalInSec 在接口中 Metric
      返回:
      the sliding window length
    • getSampleCount

      public int getSampleCount()
      从接口复制的说明: Metric
      Get sample count of the sliding window.
      指定者:
      getSampleCount 在接口中 Metric
      返回:
      sample count of the sliding window.