接口 Metric
- 所有超级接口:
DebugSupport
- 所有已知实现类:
ArrayMetric
Represents a basic structure recording invocation metrics of protected resources.
- 作者:
- jialiang.linjl, Eric Zhao
-
方法概要
修饰符和类型方法说明voidaddBlock(int n) Add current block count.voidaddException(int n) Add current exception count.voidaddOccupiedPass(int acquireCount) Add occupied pass, which represents pass requests that borrow the latter windows' token.voidaddPass(int n) Add current pass count.voidaddRT(long rt) Add given RT to current total RT.voidaddSuccess(int n) Add current completed count.voidaddWaiting(long futureTime, int acquireCount) Add request that occupied.longblock()Get total block count.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.intGet sample count of the sliding window.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.从接口继承的方法 com.alibaba.csp.sentinel.slots.statistic.metric.DebugSupport
debug
-
方法详细资料
-
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 includeoccupiedPass()- 返回:
- 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
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()
-