所有超级接口:
DebugSupport
所有已知实现类:
ArrayMetric

public interface Metric extends DebugSupport
Represents a basic structure recording invocation metrics of protected resources.
作者:
jialiang.linjl, Eric Zhao
  • 方法详细资料

    • success

      long success()
      Get total success count.
      返回:
      success count
    • maxSuccess

      long maxSuccess()
      Get max success count.
      返回:
      max success count
    • exception

      long exception()
      Get total exception count.
      返回:
      exception count
    • block

      long block()
      Get total block count.
      返回:
      block count
    • pass

      long pass()
      Get total pass count. not include occupiedPass()
      返回:
      pass count
    • rt

      long rt()
      Get total response time.
      返回:
      total RT
    • minRt

      long minRt()
      Get the minimal RT.
      返回:
      minimal RT
    • details

      List<MetricNode> details()
      Get aggregated metric nodes of all resources.
      返回:
      metric node list of all resources
    • detailsOnCondition

      List<MetricNode> detailsOnCondition(Predicate<Long> timePredicate)
      Generate aggregated metric items that satisfies the time predicate.
      参数:
      timePredicate - time predicate
      返回:
      aggregated metric items
      从以下版本开始:
      1.7.0
    • windows

      MetricBucket[] windows()
      Get the raw window array.
      返回:
      window metric array
    • addException

      void addException(int n)
      Add current exception count.
      参数:
      n - count to add
    • addBlock

      void addBlock(int n)
      Add current block count.
      参数:
      n - count to add
    • addSuccess

      void addSuccess(int n)
      Add current completed count.
      参数:
      n - count to add
    • addPass

      void addPass(int n)
      Add current pass count.
      参数:
      n - count to add
    • addRT

      void addRT(long rt)
      Add given RT to current total RT.
      参数:
      rt - RT
    • getWindowIntervalInSec

      double getWindowIntervalInSec()
      Get the sliding window length in seconds.
      返回:
      the sliding window length
    • getSampleCount

      int getSampleCount()
      Get sample count of the sliding window.
      返回:
      sample count of the sliding window.
    • getWindowPass

      long getWindowPass(long timeMillis)
      Note: this operation will not perform refreshing, so will not generate new buckets.
      参数:
      timeMillis - valid time in ms
      返回:
      pass count of the bucket exactly associated to provided timestamp, or 0 if the timestamp is invalid
      从以下版本开始:
      1.5.0
    • addOccupiedPass

      void addOccupiedPass(int acquireCount)
      Add occupied pass, which represents pass requests that borrow the latter windows' token.
      参数:
      acquireCount - tokens count.
      从以下版本开始:
      1.5.0
    • addWaiting

      void addWaiting(long futureTime, int acquireCount)
      Add request that occupied.
      参数:
      futureTime - future timestamp that the acquireCount should be added on.
      acquireCount - tokens count.
      从以下版本开始:
      1.5.0
    • waiting

      long waiting()
      Get waiting pass account
      返回:
      waiting pass count
      从以下版本开始:
      1.5.0
    • occupiedPass

      long occupiedPass()
      Get occupied pass count.
      返回:
      occupied pass count
      从以下版本开始:
      1.5.0
    • previousWindowBlock

      long previousWindowBlock()
    • previousWindowPass

      long previousWindowPass()