@Test public void testReportHistograms() throws Exception { influxDbReporter.reportMetrics( metricNameMap(Gauge.class), metricNameMap(Counter.class), metricNameMap(name("histogram").build(), histogram(400)), metricNameMap(Meter.class), metricNameMap(Timer.class)); verify(httpClient).send(eq("POST"), eq("http: eq(singletonList(format("histogram,app=test count=1i,min=400,max=200,mean=400.0,p50=600.0,std=500.0,p25=0.0,p75=700.0,p95=800.0,p98=900.0,p99=1000.0,p999=1100.0 %d", timestamp)))); }
private void reportHistograms(Map<MetricName, Histogram> histograms, long timestamp) { for (Map.Entry<MetricName, Histogram> entry : histograms.entrySet()) { final Histogram hist = entry.getValue(); final Snapshot snapshot = hist.getSnapshot(); reportLine(getInfluxDbLineProtocolString(entry.getKey()), "count=" + getIntegerValue(hist.getCount()) + "," + reportHistogramSnapshot(snapshot), timestamp); } }
InfluxDbReporter extends ScheduledMetrics2Reporter { private void reportHistograms(Map<MetricName, Histogram> histograms, long timestamp) { for (Map.Entry<MetricName, Histogram> entry : histograms.entrySet()) { final Histogram hist = entry.getValue(); final Snapshot snapshot = hist.getSnapshot(); reportLine(getInfluxDbLineProtocolString(entry.getKey()), "count=" + getIntegerValue(hist.getCount()) + "," + reportHistogramSnapshot(snapshot), timestamp); } } }
InfluxDbReporter extends ScheduledMetrics2Reporter { private void reportHistograms(Map<MetricName, Histogram> histograms, long timestamp) { for (Map.Entry<MetricName, Histogram> entry : histograms.entrySet()) { final Histogram hist = entry.getValue(); final Snapshot snapshot = hist.getSnapshot(); reportLine(getInfluxDbLineProtocolString(entry.getKey()), "count=" + getIntegerValue(hist.getCount()) + "," + reportHistogramSnapshot(snapshot), timestamp); } } private  InfluxDbReporter(Builder builder); }
InfluxDbReporter extends ScheduledMetrics2Reporter { private void reportHistograms(Map<MetricName, Histogram> histograms, long timestamp) { for (Map.Entry<MetricName, Histogram> entry : histograms.entrySet()) { final Histogram hist = entry.getValue(); final Snapshot snapshot = hist.getSnapshot(); reportLine(getInfluxDbLineProtocolString(entry.getKey()), "count=" + getIntegerValue(hist.getCount()) + "," + reportHistogramSnapshot(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); }
InfluxDbReporter extends ScheduledMetrics2Reporter { private void reportHistograms(Map<MetricName, Histogram> histograms, long timestamp) { for (Map.Entry<MetricName, Histogram> entry : histograms.entrySet()) { final Histogram hist = entry.getValue(); final Snapshot snapshot = hist.getSnapshot(); reportLine(getInfluxDbLineProtocolString(entry.getKey()), "count=" + getIntegerValue(hist.getCount()) + "," + reportHistogramSnapshot(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);  }