类 ArrayMetric
java.lang.Object
com.alibaba.csp.sentinel.slots.statistic.metric.ArrayMetric
- 所有已实现的接口:
DebugSupport,Metric
The basic metric class in Sentinel using a
BucketLeapArray internal.- 作者:
- jialiang.linjl, Eric Zhao
-
构造器概要
构造器构造器说明ArrayMetric(int sampleCount, int intervalInMs) ArrayMetric(int sampleCount, int intervalInMs, boolean enableOccupy) ArrayMetric(LeapArray<MetricBucket> array) For unit test. -
方法概要
修饰符和类型方法说明voidadd(MetricEvent event, long count) voidaddBlock(int count) Add current block count.voidaddException(int count) Add current exception count.voidaddOccupiedPass(int acquireCount) Add occupied pass, which represents pass requests that borrow the latter windows' token.voidaddPass(int count) Add current pass count.voidaddRT(long rt) Add given RT to current total RT.voidaddSuccess(int count) Add current completed count.voidaddWaiting(long time, int acquireCount) Add request that occupied.longblock()Get total block count.voiddebug()For debug;details()Get aggregated metric nodes of all resources.detailsOnCondition(Predicate<Long> timePredicate) Generate aggregated metric items that satisfies the time predicate.longGet total exception count.doublegetAvg(MetricEvent event) Get average count for provided event per second.longgetCurrentCount(MetricEvent event) intGet sample count of the sliding window.longgetSum(MetricEvent event) Get total sum for provided event inintervalInSec.doubleGet the sliding window length in seconds.longgetWindowPass(long timeMillis) Note: this operation will not perform refreshing, so will not generate new buckets.longGet max success count.longminRt()Get the minimal RT.longGet occupied pass count.longpass()Get total pass count.longlonglongrt()Get total response time.longsuccess()Get total success count.longwaiting()Get waiting pass accountwindows()Get the raw window array.
-
构造器详细资料
-
ArrayMetric
public ArrayMetric(int sampleCount, int intervalInMs) -
ArrayMetric
public ArrayMetric(int sampleCount, int intervalInMs, boolean enableOccupy) -
ArrayMetric
For unit test.
-
-
方法详细资料
-
success
public long success()从接口复制的说明:MetricGet total success count. -
maxSuccess
public long maxSuccess()从接口复制的说明:MetricGet max success count.- 指定者:
maxSuccess在接口中Metric- 返回:
- max success count
-
exception
public long exception()从接口复制的说明:MetricGet total exception count. -
block
public long block()从接口复制的说明:MetricGet total block count. -
pass
public long pass()从接口复制的说明:MetricGet total pass count. not includeMetric.occupiedPass() -
occupiedPass
public long occupiedPass()从接口复制的说明:MetricGet occupied pass count.- 指定者:
occupiedPass在接口中Metric- 返回:
- occupied pass count
-
rt
public long rt()从接口复制的说明:MetricGet total response time. -
minRt
public long minRt()从接口复制的说明:MetricGet the minimal RT. -
details
从接口复制的说明:MetricGet aggregated metric nodes of all resources. -
detailsOnCondition
从接口复制的说明:MetricGenerate aggregated metric items that satisfies the time predicate.- 指定者:
detailsOnCondition在接口中Metric- 参数:
timePredicate- time predicate- 返回:
- aggregated metric items
-
windows
从接口复制的说明:MetricGet the raw window array. -
addException
public void addException(int count) 从接口复制的说明:MetricAdd current exception count.- 指定者:
addException在接口中Metric- 参数:
count- count to add
-
addBlock
public void addBlock(int count) 从接口复制的说明:MetricAdd current block count. -
addWaiting
public void addWaiting(long time, int acquireCount) 从接口复制的说明:MetricAdd request that occupied.- 指定者:
addWaiting在接口中Metric- 参数:
time- future timestamp that the acquireCount should be added on.acquireCount- tokens count.
-
addOccupiedPass
public void addOccupiedPass(int acquireCount) 从接口复制的说明:MetricAdd occupied pass, which represents pass requests that borrow the latter windows' token.- 指定者:
addOccupiedPass在接口中Metric- 参数:
acquireCount- tokens count.
-
addSuccess
public void addSuccess(int count) 从接口复制的说明:MetricAdd current completed count.- 指定者:
addSuccess在接口中Metric- 参数:
count- count to add
-
addPass
public void addPass(int count) 从接口复制的说明:MetricAdd current pass count. -
addRT
public void addRT(long rt) 从接口复制的说明:MetricAdd given RT to current total RT. -
debug
public void debug()从接口复制的说明:DebugSupportFor debug;- 指定者:
debug在接口中DebugSupport
-
previousWindowBlock
public long previousWindowBlock()- 指定者:
previousWindowBlock在接口中Metric
-
previousWindowPass
public long previousWindowPass()- 指定者:
previousWindowPass在接口中Metric
-
add
-
getCurrentCount
-
getSum
Get total sum for provided event inintervalInSec.- 参数:
event- event to calculate- 返回:
- total sum for event
-
getAvg
Get average count for provided event per second.- 参数:
event- event to calculate- 返回:
- average count per second for event
-
getWindowPass
public long getWindowPass(long timeMillis) 从接口复制的说明:MetricNote: 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()从接口复制的说明:MetricGet waiting pass account -
getWindowIntervalInSec
public double getWindowIntervalInSec()从接口复制的说明:MetricGet the sliding window length in seconds.- 指定者:
getWindowIntervalInSec在接口中Metric- 返回:
- the sliding window length
-
getSampleCount
public int getSampleCount()从接口复制的说明:MetricGet sample count of the sliding window.- 指定者:
getSampleCount在接口中Metric- 返回:
- sample count of the sliding window.
-