@Test public void testDropwizardTime() { MetricRegistry reg = new MetricRegistry(); DropWizardMetricsRegistry dwreg = new DropWizardMetricsRegistry(Clock.SYSTEM, reg); Timer timer = dwreg.timer(dwreg.createId("a.b.c")); timer.record(123, TimeUnit.SECONDS); com.codahale.metrics.Timer timer2 = reg.timer("a.b.c"); System.out.println(timer2.getCount()); Assert.assertEquals(1, timer2.getCount()); }
@Override public Timer timer(Id id) { if (overSize(id)) { return NoopRegistry.INSTANCE.timer(id); } final String name = toMetricName(id); return new DwMetricsTimer(clock(), id, impl.timer(name)); }
DropWizardMetricsRegistry extends MetricRegistry { @Override public Timer timer(Id id) { if (overSize(id)) { return NoopRegistry.INSTANCE.timer(id); } final String name = toMetricName(id); return new DwMetricsTimer(clock(), id, impl.timer(name)); } }
DropWizardMetricsRegistry extends MetricRegistry { @Override public Timer timer(Id id) { if (overSize(id)) { return NoopRegistry.INSTANCE.timer(id); } final String name = toMetricName(id); return new DwMetricsTimer(clock(), id, impl.timer(name)); } DropWizardMetricsRegistry();  DropWizardMetricsRegistry(Clock clock, com.codahale.metrics.MetricRegistry impl);  DropWizardMetricsRegistry(Clock clock, com.codahale.metrics.MetricRegistry impl,
                                     MetricConfig metricConfig); }
DropWizardMetricsRegistry extends MetricRegistry { @Override public Timer timer(Id id) { if (overSize(id)) { return NoopRegistry.INSTANCE.timer(id); } final String name = toMetricName(id); return new DwMetricsTimer(clock(), id, impl.timer(name)); } DropWizardMetricsRegistry();  DropWizardMetricsRegistry(Clock clock, com.codahale.metrics.MetricRegistry impl);  DropWizardMetricsRegistry(Clock clock, com.codahale.metrics.MetricRegistry impl,
                                     MetricConfig metricConfig); @Override Gauge<T> gauge(Id id, Gauge<T> gauge); @Override Counter counter(Id id); @Override DistributionSummary distributionSummary(Id id); @Override Timer timer(Id id); @Override void register(final Metric metric); @Override void removeMetric(Id id); @Override void propagate(String msg, Throwable t); @Override MixinMetric mixinMetric(Id id); @Override void registerExtendedMetrics(); @Override Info info(Id id, Y info); @Override X get(Id id); @Override Iterator<Metric> iterator(); boolean overSize(Id id); }
DropWizardMetricsRegistry extends MetricRegistry { @Override public Timer timer(Id id) { if (overSize(id)) { return NoopRegistry.INSTANCE.timer(id); } final String name = toMetricName(id); return new DwMetricsTimer(clock(), id, impl.timer(name)); } DropWizardMetricsRegistry();  DropWizardMetricsRegistry(Clock clock, com.codahale.metrics.MetricRegistry impl);  DropWizardMetricsRegistry(Clock clock, com.codahale.metrics.MetricRegistry impl,
                                     MetricConfig metricConfig); @Override Gauge<T> gauge(Id id, Gauge<T> gauge); @Override Counter counter(Id id); @Override DistributionSummary distributionSummary(Id id); @Override Timer timer(Id id); @Override void register(final Metric metric); @Override void removeMetric(Id id); @Override void propagate(String msg, Throwable t); @Override MixinMetric mixinMetric(Id id); @Override void registerExtendedMetrics(); @Override Info info(Id id, Y info); @Override X get(Id id); @Override Iterator<Metric> iterator(); boolean overSize(Id id);  }