use of io.dropwizard.metrics.influxdb.data.InfluxDbPoint in project light-4j by networknt.
the class InfluxDbReporterTest method reportsDoubleGaugeValues.
@Test
public void reportsDoubleGaugeValues() throws Exception {
reporter.report(map("gauge", gauge(1.1)), this.map(), this.map(), this.map(), this.map());
final ArgumentCaptor<InfluxDbPoint> influxDbPointCaptor = ArgumentCaptor.forClass(InfluxDbPoint.class);
Mockito.verify(influxDb, atLeastOnce()).appendPoints(influxDbPointCaptor.capture());
InfluxDbPoint point = influxDbPointCaptor.getValue();
/*
assertThat(point.getMeasurement()).isEqualTo("gauge");
assertThat(point.getFields()).isNotEmpty();
assertThat(point.getFields()).hasSize(1);
assertThat(point.getFields()).contains(entry("value", 1.1));
*/
}
use of io.dropwizard.metrics.influxdb.data.InfluxDbPoint in project light-4j by networknt.
the class InfluxDbReporterTest method reportsCounters.
@Test
public void reportsCounters() throws Exception {
final Counter counter = mock(Counter.class);
Mockito.when(counter.getCount()).thenReturn(100L);
reporter.report(this.map(), this.map("counter", counter), this.map(), this.map(), this.map());
final ArgumentCaptor<InfluxDbPoint> influxDbPointCaptor = ArgumentCaptor.forClass(InfluxDbPoint.class);
Mockito.verify(influxDb, atLeastOnce()).appendPoints(influxDbPointCaptor.capture());
InfluxDbPoint point = influxDbPointCaptor.getValue();
System.out.println("point = " + point);
/*
assertThat(point.getMeasurement()).isEqualTo("counter");
assertThat(point.getFields()).isNotEmpty();
assertThat(point.getFields()).hasSize(1);
assertThat(point.getFields()).contains(entry("count", 100L));
*/
}
use of io.dropwizard.metrics.influxdb.data.InfluxDbPoint in project light-4j by networknt.
the class InfluxDbReporterTest method reportsIntegerGaugeValues.
@Test
public void reportsIntegerGaugeValues() throws Exception {
reporter.report(map("gauge", gauge(1)), this.map(), this.map(), this.map(), this.map());
final ArgumentCaptor<InfluxDbPoint> influxDbPointCaptor = ArgumentCaptor.forClass(InfluxDbPoint.class);
Mockito.verify(influxDb, atLeastOnce()).appendPoints(influxDbPointCaptor.capture());
InfluxDbPoint point = influxDbPointCaptor.getValue();
/*
assertThat(point.getMeasurement()).isEqualTo("gauge");
assertThat(point.getFields()).isNotEmpty();
assertThat(point.getFields()).hasSize(1);
assertThat(point.getFields()).contains(entry("value", 1));
*/
}
use of io.dropwizard.metrics.influxdb.data.InfluxDbPoint in project light-4j by networknt.
the class InfluxDbReporterTest method reportsFloatGaugeValues.
@Test
public void reportsFloatGaugeValues() throws Exception {
reporter.report(map("gauge", gauge(1.1f)), this.map(), this.map(), this.map(), this.map());
final ArgumentCaptor<InfluxDbPoint> influxDbPointCaptor = ArgumentCaptor.forClass(InfluxDbPoint.class);
Mockito.verify(influxDb, atLeastOnce()).appendPoints(influxDbPointCaptor.capture());
InfluxDbPoint point = influxDbPointCaptor.getValue();
/*
assertThat(point.getMeasurement()).isEqualTo("gauge");
assertThat(point.getFields()).isNotEmpty();
assertThat(point.getFields()).hasSize(1);
assertThat(point.getFields()).contains(entry("value", 1.1f));
*/
}
use of io.dropwizard.metrics.influxdb.data.InfluxDbPoint in project light-4j by networknt.
the class InfluxDbReporterTest method reportsLongGaugeValues.
@Test
public void reportsLongGaugeValues() throws Exception {
reporter.report(map("gauge", gauge(1L)), this.map(), this.map(), this.map(), this.map());
final ArgumentCaptor<InfluxDbPoint> influxDbPointCaptor = ArgumentCaptor.forClass(InfluxDbPoint.class);
Mockito.verify(influxDb, atLeastOnce()).appendPoints(influxDbPointCaptor.capture());
InfluxDbPoint point = influxDbPointCaptor.getValue();
/*
assertThat(point.getMeasurement()).isEqualTo("gauge");
assertThat(point.getFields()).isNotEmpty();
assertThat(point.getFields()).hasSize(1);
assertThat(point.getFields()).contains(entry("value", 1L));
*/
}
Aggregations