@Test public void testReportGauges() throws Exception { influxDbReporter.reportMetrics( metricNameMap(name("cpu_usage").type("user").tag("core", "1").build(), gauge(3)), metricNameMap(Counter.class), metricNameMap(Histogram.class), metricNameMap(Meter.class), metricNameMap(Timer.class)); verify(httpClient).send(eq("POST"), eq("http: eq(singletonList(format("cpu_usage,core=1,type=user,app=test value=3 %d", timestamp)))); }
private void reportGauges(Map<MetricName, Gauge> gauges, long timestamp) { for (Map.Entry<MetricName, Gauge> entry : gauges.entrySet()) { final String value = getGaugeValueForInfluxDb(entry.getValue().getValue()); if (value != null) { reportLine(getInfluxDbLineProtocolString(entry.getKey()), value, timestamp); } } }
InfluxDbReporter extends ScheduledMetrics2Reporter { private void reportGauges(Map<MetricName, Gauge> gauges, long timestamp) { for (Map.Entry<MetricName, Gauge> entry : gauges.entrySet()) { final String value = getGaugeValueForInfluxDb(entry.getValue().getValue()); if (value != null) { reportLine(getInfluxDbLineProtocolString(entry.getKey()), value, timestamp); } } } }
InfluxDbReporter extends ScheduledMetrics2Reporter { private void reportGauges(Map<MetricName, Gauge> gauges, long timestamp) { for (Map.Entry<MetricName, Gauge> entry : gauges.entrySet()) { final String value = getGaugeValueForInfluxDb(entry.getValue().getValue()); if (value != null) { reportLine(getInfluxDbLineProtocolString(entry.getKey()), value, timestamp); } } } private  InfluxDbReporter(Builder builder); }
InfluxDbReporter extends ScheduledMetrics2Reporter { private void reportGauges(Map<MetricName, Gauge> gauges, long timestamp) { for (Map.Entry<MetricName, Gauge> entry : gauges.entrySet()) { final String value = getGaugeValueForInfluxDb(entry.getValue().getValue()); if (value != null) { reportLine(getInfluxDbLineProtocolString(entry.getKey()), value, 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 reportGauges(Map<MetricName, Gauge> gauges, long timestamp) { for (Map.Entry<MetricName, Gauge> entry : gauges.entrySet()) { final String value = getGaugeValueForInfluxDb(entry.getValue().getValue()); if (value != null) { reportLine(getInfluxDbLineProtocolString(entry.getKey()), value, 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);  }