public static interface Compass.Context extends Closeable
Timer.time()| 限定符和类型 | 方法和说明 |
|---|---|
void |
error(String errorCode)
Mark one occurrence of the specified errorCode
标记一次调用为错误,并且错误码为指定的错误码
|
void |
markAddon(String suffix)
Mark one occurrence of the added-on metric with specified suffix
标记一次扩展指标,用户可自定义后缀名
例如,在统计缓存的指标时,除了统计缓存访问次数,还需要统计缓存命中次数,
这个命中次数可能是当满足一定条件才会发生的
这时候可以根据条件,当满足条件时候调用: markAddon(".hit")
会产生一个后缀为.hit.count的Counter来进行计数
|
long |
stop()
Updates the timer with the difference between current and start time.
|
void |
success()
Mark the invocation as a successful invocation.
|
long stop()
void success()
void error(String errorCode)
errorCode - the errorCode that will be markedvoid markAddon(String suffix)
suffix - the suffix for the metricCopyright © 2019. All rights reserved.