public interface Compass extends Metered, Sampling
Timer to measure the qps and rt distribution
a Counter to measure the success count
a RatioGauge to measure the success rate
a Map of Counter> to record the count for each error code
a Map of Counter> to record the count for each addon| 限定符和类型 | 接口和说明 |
|---|---|
static interface |
Compass.Context
A timing context.
|
| 限定符和类型 | 方法和说明 |
|---|---|
Map<String,BucketCounter> |
getAddonCounts()
Get the number of occurrence of added on metric
获取扩展指标,包含每个扩展指标的后缀名以及计数
|
BucketCounter |
getBucketSuccessCount()
获取按时间间隔统计的调用成功数
|
Map<String,BucketCounter> |
getErrorCodeCounts()
Get the distribution of error code
获取错误码的分布,每个错误码及错误次数
|
long |
getSuccessCount()
Get the success count of the invocation
获取调用成功数
|
double |
getSuccessRate()
已过时。
|
Compass.Context |
time()
Returns a new
Compass.Context. |
<T> T |
time(Callable<T> event)
Times and records the duration of event.
|
void |
update(long duration,
TimeUnit unit)
Adds a recorded duration.
|
void |
update(long duration,
TimeUnit unit,
boolean isSuccess,
String errorCode,
String addon)
Adds a recorded duration
|
getCount, getFifteenMinuteRate, getFiveMinuteRate, getInstantCount, getInstantCount, getInstantCountInterval, getMeanRate, getOneMinuteRatelastUpdateTimegetSnapshotvoid update(long duration,
TimeUnit unit)
duration - the length of the durationunit - the scale unit of durationvoid update(long duration,
TimeUnit unit,
boolean isSuccess,
String errorCode,
String addon)
duration - the length of the durationunit - the scale unit of durationisSuccess - whether it is successerrorCode - the error code with this record, if not, null be passedaddon - the addon with this record, if not, null be passed<T> T time(Callable<T> event) throws Exception
T - the type of the value returned by eventevent - a Callable whose Callable.call() method implements a process
whose duration should be timedeventException - if event throws an ExceptionCompass.Context time()
Compass.Context.
获取一个上下文实例, 这个上下文中记录了这次调用的起始时间Compass.ContextCompass.ContextMap<String,BucketCounter> getErrorCodeCounts()
@Deprecated double getSuccessRate()
long getSuccessCount()
BucketCounter getBucketSuccessCount()
Map<String,BucketCounter> getAddonCounts()
Copyright © 2019. All rights reserved.