use of wavefront.report.ReportPoint in project java by wavefrontHQ.
the class GraphiteDecoderTest method testSimple.
@Test
public void testSimple() throws Exception {
GraphiteDecoder decoder = new GraphiteDecoder(emptyCustomSourceTags);
List<ReportPoint> out = Lists.newArrayList();
decoder.decodeReportPoints("test 1 host=test", out, "customer");
ReportPoint point = out.get(0);
assertEquals("customer", point.getTable());
assertEquals("test", point.getMetric());
assertEquals("test", point.getHost());
assertEquals(1.0, point.getValue());
}
use of wavefront.report.ReportPoint in project java by wavefrontHQ.
the class GraphiteDecoderTest method testSource.
@Test
public void testSource() throws Exception {
GraphiteDecoder decoder = new GraphiteDecoder(emptyCustomSourceTags);
List<ReportPoint> out = Lists.newArrayList();
decoder.decodeReportPoints("test 1 source=test", out, "customer");
ReportPoint point = out.get(0);
assertEquals("customer", point.getTable());
assertEquals("test", point.getMetric());
assertEquals("test", point.getHost());
assertEquals(1.0, point.getValue());
}
use of wavefront.report.ReportPoint in project java by wavefrontHQ.
the class GraphiteDecoderTest method testFormatWithNoTags.
@Test
public void testFormatWithNoTags() throws Exception {
GraphiteDecoder decoder = new GraphiteDecoder("localhost", emptyCustomSourceTags);
List<ReportPoint> out = new ArrayList<>();
decoder.decodeReportPoints("tsdb.vehicle.charge.battery_level 93", out);
ReportPoint point = out.get(0);
assertEquals("tsdb", point.getTable());
assertEquals("vehicle.charge.battery_level", point.getMetric());
assertEquals(93.0, point.getValue());
}
use of wavefront.report.ReportPoint in project java by wavefrontHQ.
the class GraphiteDecoderTest method testIpV6Host.
@Test
public void testIpV6Host() throws Exception {
GraphiteDecoder decoder = new GraphiteDecoder("localhost", emptyCustomSourceTags);
List<ReportPoint> out = new ArrayList<>();
decoder.decodeReportPoints("tsdb.vehicle.charge.battery_level 93 host=2001:db8:3333:4444:5555:6666:7777:8888", out);
ReportPoint point = out.get(0);
assertEquals("tsdb", point.getTable());
assertEquals("vehicle.charge.battery_level", point.getMetric());
assertEquals(93.0, point.getValue());
assertEquals("2001:db8:3333:4444:5555:6666:7777:8888", point.getHost());
}
use of wavefront.report.ReportPoint in project java by wavefrontHQ.
the class GraphiteDecoderTest method testUserPrefOverridesDefault.
@Test
public void testUserPrefOverridesDefault() throws Exception {
List<String> customSourceTags = new ArrayList<String>();
customSourceTags.add("fqdn");
GraphiteDecoder decoder = new GraphiteDecoder("localhost", customSourceTags);
List<ReportPoint> out = Lists.newArrayList();
decoder.decodeReportPoints("test 1 fqdn=machine.company.com", out, "customer");
ReportPoint point = out.get(0);
assertEquals("customer", point.getTable());
assertEquals("test", point.getMetric());
assertEquals("machine.company.com", point.getHost());
assertEquals("machine.company.com", point.getAnnotations().get("fqdn"));
assertEquals(1.0, point.getValue());
}
Aggregations