类 LocalSimpleCountRateCounter

java.lang.Object
com.alibaba.nacos.plugin.control.tps.barrier.RateCounter
com.alibaba.nacos.plugin.control.tps.barrier.LocalSimpleCountRateCounter

public class LocalSimpleCountRateCounter extends RateCounter
local simple count rate counter.
作者:
shiyiyue
  • 字段详细资料

  • 构造器详细资料

    • LocalSimpleCountRateCounter

      public LocalSimpleCountRateCounter(String name, TimeUnit period)
  • 方法详细资料

    • add

      public long add(long timestamp, long count)
      从类复制的说明: RateCounter
      add count for the second of timestamp.
      指定者:
      add 在类中 RateCounter
      参数:
      timestamp - timestamp.
      count - count.
      返回:
    • tryAdd

      public boolean tryAdd(long timestamp, long countDelta, long upperLimit)
      从类复制的说明: RateCounter
      add intercepted count for the second of timestamp.
      指定者:
      tryAdd 在类中 RateCounter
      参数:
      timestamp - timestamp
      countDelta - count
      upperLimit - upperLimit
      返回:
    • minus

      public void minus(long timestamp, long count)
    • getCount

      public long getCount(long timestamp)
      从类复制的说明: RateCounter
      get count of the second of timestamp.
      指定者:
      getCount 在类中 RateCounter
      参数:
      timestamp - timestamp.
      返回:
    • getPoint

      private LocalSimpleCountRateCounter.TpsSlot getPoint(long timeStamp)
      get slot of the timestamp second,read only ,return nul if not exist.
      参数:
      timeStamp - the timestamp second.
      返回:
      tps slot.
    • createSlotIfAbsent

      public LocalSimpleCountRateCounter.TpsSlot createSlotIfAbsent(long timeStamp)
      get slot of the timestamp second,create if not exist.
      参数:
      timeStamp - the timestamp second.
      返回:
      tps slot.