public class NodeMetrics extends Object
| 构造器和说明 |
|---|
NodeMetrics(boolean enableMetrics) |
| 限定符和类型 | 方法和说明 |
|---|---|
com.codahale.metrics.MetricRegistry |
getMetricRegistry()
Retrieve the metrics registry, return null if is is disabled.
|
Map<String,com.codahale.metrics.Metric> |
getMetrics()
Retrieve the metrics map, returns empty map if it is disabled.
|
boolean |
isEnabled()
Whether metric is enabled.
|
void |
recordLatency(String key,
long duration)
Records operation latency.
|
void |
recordSize(String key,
long size)
Records operation batch size.
|
void |
recordTimes(String key,
long times)
Records operation times.
|
public Map<String,com.codahale.metrics.Metric> getMetrics()
public com.codahale.metrics.MetricRegistry getMetricRegistry()
public boolean isEnabled()
public void recordTimes(String key, long times)
key - key of operationtimes - times of operationpublic void recordSize(String key, long size)
key - key of operationsize - size of operationpublic void recordLatency(String key, long duration)
key - key of operationduration - duration of operationCopyright © 2021. All rights reserved.