类 RateCounter
java.lang.Object
com.alibaba.nacos.plugin.control.tps.barrier.RateCounter
- 直接已知子类:
LocalSimpleCountRateCounter
abstract rate counter.
- 作者:
- zunfei.lzf
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明abstract longadd(long timestamp, long count) add count for the second of timestamp.abstract longgetCount(long timestamp) get count of the second of timestamp.getName()static longgetTrimMillsOfHour(long timeStamp) get trim mills of second.static longgetTrimMillsOfMinute(long timeStamp) get trim mills of second.static longgetTrimMillsOfSecond(long timeStamp) get trim mills of second.abstract booleantryAdd(long timestamp, long countDelta, long upperLimit) add intercepted count for the second of timestamp.
-
字段详细资料
-
name
rate count name. -
period
rate period.
-
-
构造器详细资料
-
RateCounter
-
-
方法详细资料
-
getPeriod
-
add
public abstract long add(long timestamp, long count) add count for the second of timestamp.- 参数:
timestamp- timestamp.count- count.- 返回:
-
tryAdd
public abstract boolean tryAdd(long timestamp, long countDelta, long upperLimit) add intercepted count for the second of timestamp.- 参数:
timestamp- timestampcountDelta- countupperLimit- upperLimit- 返回:
-
getCount
public abstract long getCount(long timestamp) get count of the second of timestamp.- 参数:
timestamp- timestamp.- 返回:
-
getName
-
getTrimMillsOfMinute
public static long getTrimMillsOfMinute(long timeStamp) get trim mills of second.- 参数:
timeStamp- timestamp milliseconds.- 返回:
-
getTrimMillsOfSecond
public static long getTrimMillsOfSecond(long timeStamp) get trim mills of second.- 参数:
timeStamp- timestamp milliseconds.- 返回:
-
getTrimMillsOfHour
public static long getTrimMillsOfHour(long timeStamp) get trim mills of second.- 参数:
timeStamp- timestamp milliseconds.- 返回:
-