类 LocalSimpleCountRateCounter
java.lang.Object
com.alibaba.nacos.plugin.control.tps.barrier.RateCounter
com.alibaba.nacos.plugin.control.tps.barrier.LocalSimpleCountRateCounter
local simple count rate counter.
- 作者:
- shiyiyue
-
嵌套类概要
嵌套类修饰符和类型类说明(专用程序包) static class(专用程序包) static class -
字段概要
字段修饰符和类型字段说明private static final intprivate List<LocalSimpleCountRateCounter.TpsSlot> (专用程序包) long -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明longadd(long timestamp, long count) add count for the second of timestamp.createSlotIfAbsent(long timeStamp) get slot of the timestamp second,create if not exist.longgetCount(long timestamp) get count of the second of timestamp.getPoint(long timeStamp) get slot of the timestamp second,read only ,return nul if not exist.voidminus(long timestamp, long count) booleantryAdd(long timestamp, long countDelta, long upperLimit) add intercepted count for the second of timestamp.从类继承的方法 com.alibaba.nacos.plugin.control.tps.barrier.RateCounter
getName, getPeriod, getTrimMillsOfHour, getTrimMillsOfMinute, getTrimMillsOfSecond
-
字段详细资料
-
DEFAULT_RECORD_SIZE
private static final int DEFAULT_RECORD_SIZE- 另请参阅:
-
startTime
long startTime -
slotList
-
-
构造器详细资料
-
LocalSimpleCountRateCounter
-
-
方法详细资料
-
add
public long add(long timestamp, long count) 从类复制的说明:RateCounteradd count for the second of timestamp.- 指定者:
add在类中RateCounter- 参数:
timestamp- timestamp.count- count.- 返回:
-
tryAdd
public boolean tryAdd(long timestamp, long countDelta, long upperLimit) 从类复制的说明:RateCounteradd intercepted count for the second of timestamp.- 指定者:
tryAdd在类中RateCounter- 参数:
timestamp- timestampcountDelta- countupperLimit- upperLimit- 返回:
-
minus
public void minus(long timestamp, long count) -
getCount
public long getCount(long timestamp) 从类复制的说明:RateCounterget count of the second of timestamp.- 指定者:
getCount在类中RateCounter- 参数:
timestamp- timestamp.- 返回:
-
getPoint
get slot of the timestamp second,read only ,return nul if not exist.- 参数:
timeStamp- the timestamp second.- 返回:
- tps slot.
-
createSlotIfAbsent
get slot of the timestamp second,create if not exist.- 参数:
timeStamp- the timestamp second.- 返回:
- tps slot.
-