@Test public void testTimer() throws Exception { metricRegistry.timer("blah-timer"); reporter.reportOnce(); verifyHistogramStats("blah-timer", "timer"); verifyMeterStats("blah-timer", "timer"); }
@VisibleForTesting void reportOnce() { additionalAttributes = additionalAttributesSupplier.get(); if (additionalAttributes == null) { additionalAttributes = Collections.emptyMap(); } metricRegistry.getGauges().forEach(this::reportGauge); metricRegistry.getCounters().forEach(this::reportCounter); metricRegistry.getMeters().forEach(this::reportMeter); metricRegistry.getHistograms().forEach(this::reportHistogram); metricRegistry.getTimers().forEach(this::reportTimer); }
FastForwardReporter implements Managed { @VisibleForTesting void reportOnce() { additionalAttributes = additionalAttributesSupplier.get(); if (additionalAttributes == null) { additionalAttributes = Collections.emptyMap(); } metricRegistry.getGauges().forEach(this::reportGauge); metricRegistry.getCounters().forEach(this::reportCounter); metricRegistry.getMeters().forEach(this::reportMeter); metricRegistry.getHistograms().forEach(this::reportHistogram); metricRegistry.getTimers().forEach(this::reportTimer); } }
FastForwardReporter implements Managed { @VisibleForTesting void reportOnce() { additionalAttributes = additionalAttributesSupplier.get(); if (additionalAttributes == null) { additionalAttributes = Collections.emptyMap(); } metricRegistry.getGauges().forEach(this::reportGauge); metricRegistry.getCounters().forEach(this::reportCounter); metricRegistry.getMeters().forEach(this::reportMeter); metricRegistry.getHistograms().forEach(this::reportHistogram); metricRegistry.getTimers().forEach(this::reportTimer); } FastForwardReporter(FastForward fastForward, MetricRegistry metricRegistry,
                      ScheduledExecutorService executor, String key,
                      long interval, TimeUnit intervalTimeUnit,
                      Supplier<Map<String, String>> additionalAttributes); }
FastForwardReporter implements Managed { @VisibleForTesting void reportOnce() { additionalAttributes = additionalAttributesSupplier.get(); if (additionalAttributes == null) { additionalAttributes = Collections.emptyMap(); } metricRegistry.getGauges().forEach(this::reportGauge); metricRegistry.getCounters().forEach(this::reportCounter); metricRegistry.getMeters().forEach(this::reportMeter); metricRegistry.getHistograms().forEach(this::reportHistogram); metricRegistry.getTimers().forEach(this::reportTimer); } FastForwardReporter(FastForward fastForward, MetricRegistry metricRegistry,
                      ScheduledExecutorService executor, String key,
                      long interval, TimeUnit intervalTimeUnit,
                      Supplier<Map<String, String>> additionalAttributes); static FastForwardReporter create(
      MetricRegistry registry,
      Optional<HostAndPort> address,
      String metricKey,
      int intervalSeconds); static FastForwardReporter create(
      MetricRegistry registry,
      Optional<HostAndPort> address,
      String metricKey, int intervalSeconds,
      Supplier<Map<String, String>> additionalAttributes); @Override void start(); @Override void stop(); }
FastForwardReporter implements Managed { @VisibleForTesting void reportOnce() { additionalAttributes = additionalAttributesSupplier.get(); if (additionalAttributes == null) { additionalAttributes = Collections.emptyMap(); } metricRegistry.getGauges().forEach(this::reportGauge); metricRegistry.getCounters().forEach(this::reportCounter); metricRegistry.getMeters().forEach(this::reportMeter); metricRegistry.getHistograms().forEach(this::reportHistogram); metricRegistry.getTimers().forEach(this::reportTimer); } FastForwardReporter(FastForward fastForward, MetricRegistry metricRegistry,
                      ScheduledExecutorService executor, String key,
                      long interval, TimeUnit intervalTimeUnit,
                      Supplier<Map<String, String>> additionalAttributes); static FastForwardReporter create(
      MetricRegistry registry,
      Optional<HostAndPort> address,
      String metricKey,
      int intervalSeconds); static FastForwardReporter create(
      MetricRegistry registry,
      Optional<HostAndPort> address,
      String metricKey, int intervalSeconds,
      Supplier<Map<String, String>> additionalAttributes); @Override void start(); @Override void stop();  }