【问题标题】:Dropwizard gauge frequencyDropwizard仪表频率
【发布时间】:2018-11-11 01:32:32
【问题描述】:

我在我的代码中使用 dropwizard 仪表功能如下:

    private AtomicInteger heapUsageAfterCollectionThresholdExceeded;

       new Gauge<Integer>() {
        @Override
        public Integer getValue() {
            return heapUsageThresholdExceeded.get();
        }

现在这开始将 heapUsageThresholdExceeded 的值推送到石墨。我期待在石墨中看到整数值。但在石墨中,我看到报告为小数点值(0.15)的值。我有以下问题:

  1. 为什么整数仪表报告为十进制值?
  2. 放置向导多久测量/推送已注册仪表的指标?

参考:https://metrics.dropwizard.io/3.1.0/apidocs/com/codahale/metrics/Gauge.html

【问题讨论】:

    标签: java dropwizard graphite gauge


    【解决方案1】:

    要回答您的第二个问题,这取决于报告指标的频率。 default frequency 是 1 分钟

    您可以在配置文件中指定频率。例如 -

    metrics:
      reporters:
        - type: graphite
          host: localhost
          port: 2003
          prefix: example
          frequency: 1m
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-12-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多