InfluxDbReporter extends ScheduledMetrics2Reporter { private void reportTimers(Map<MetricName, Timer> timers, long timestamp) { for (Map.Entry<MetricName, Timer> entry : timers.entrySet()) { final Timer timer = entry.getValue(); final Snapshot snapshot = timer.getSnapshot(); reportLine(getInfluxDbLineProtocolString(entry.getKey()), reportMetered(timer) + "," + reportTimerSnapshot(snapshot), timestamp); } } private  InfluxDbReporter(Builder builder); static Builder forRegistry(Metric2Registry registry, CorePlugin corePlugin); @Override void reportMetrics(Map<MetricName, Gauge> gauges,
							  Map<MetricName, Counter> counters,
							  Map<MetricName, Histogram> histograms,
							  Map<MetricName, Meter> meters,
							  Map<MetricName, Timer> timers); static String getInfluxDbLineProtocolString(MetricName metricName);  }
@Test public void testReportTimers() throws Exception { influxDbReporter.reportMetrics( metricNameMap(Gauge.class), metricNameMap(Counter.class), metricNameMap(Histogram.class), metricNameMap(Meter.class), metricNameMap(name("response_time").build(), timer(400))); verify(httpClient).send(eq("POST"), eq("http: eq(singletonList(format("response_time,app=test count=1i,m1_rate=3.0,m5_rate=4.0,m15_rate=5.0,mean_rate=2.0,min=0.4,max=0.2,mean=0.4,p50=0.6,std=0.5,p25=0.0,p75=0.7,p95=0.8,p98=0.9,p99=1.0,p999=1.1 %d", timestamp)))); }