Dropwizard 仪表频率
Dropwizard gauge frequency
我在我的代码中使用了 dropwizard 仪表功能,如下所示:
private AtomicInteger heapUsageAfterCollectionThresholdExceeded;
new Gauge<Integer>() {
@Override
public Integer getValue() {
return heapUsageThresholdExceeded.get();
}
现在这开始将 heapUsageThresholdExceeded 的值推向石墨。我期待在石墨中看到整数值。但在石墨中,我看到报告的值是小数点值 (0.15)。我有以下问题:
- 为什么整数仪表报告为小数值?
- 下降向导 measure/push 注册仪表的指标多久出现一次?
参考:https://metrics.dropwizard.io/3.1.0/apidocs/com/codahale/metrics/Gauge.html
要回答您的第二个问题,这取决于报告指标的频率。 default frequency是1分钟
您可以在配置文件中指定频率。例如 -
metrics:
reporters:
- type: graphite
host: localhost
port: 2003
prefix: example
frequency: 1m
我在我的代码中使用了 dropwizard 仪表功能,如下所示:
private AtomicInteger heapUsageAfterCollectionThresholdExceeded;
new Gauge<Integer>() {
@Override
public Integer getValue() {
return heapUsageThresholdExceeded.get();
}
现在这开始将 heapUsageThresholdExceeded 的值推向石墨。我期待在石墨中看到整数值。但在石墨中,我看到报告的值是小数点值 (0.15)。我有以下问题:
- 为什么整数仪表报告为小数值?
- 下降向导 measure/push 注册仪表的指标多久出现一次?
参考:https://metrics.dropwizard.io/3.1.0/apidocs/com/codahale/metrics/Gauge.html
要回答您的第二个问题,这取决于报告指标的频率。 default frequency是1分钟
您可以在配置文件中指定频率。例如 -
metrics:
reporters:
- type: graphite
host: localhost
port: 2003
prefix: example
frequency: 1m