use of wavefront.report.ReportPoint in project java by wavefrontHQ.
the class GraphiteDecoderTest method testNumberLookingTagValue.
@Test
public void testNumberLookingTagValue() {
GraphiteDecoder decoder = new GraphiteDecoder(emptyCustomSourceTags);
List<ReportPoint> out = Lists.newArrayList();
decoder.decodeReportPoints("vm.guest.virtualDisk.mediumSeeks.latest 4.00 1439250320 " + "host=iadprdhyp02.iad.corp.com version=\"1.0.0-030051.d0e485f\"", out, "customer");
ReportPoint point = out.get(0);
assertEquals("customer", point.getTable());
assertEquals("vm.guest.virtualDisk.mediumSeeks.latest", point.getMetric());
assertEquals("iadprdhyp02.iad.corp.com", point.getHost());
assertEquals("1.0.0-030051.d0e485f", point.getAnnotations().get("version"));
assertEquals(4.0, point.getValue());
}
use of wavefront.report.ReportPoint in project java by wavefrontHQ.
the class GraphiteDecoderTest method testIpV4Host.
@Test
public void testIpV4Host() throws Exception {
GraphiteDecoder decoder = new GraphiteDecoder("localhost", emptyCustomSourceTags);
List<ReportPoint> out = new ArrayList<>();
decoder.decodeReportPoints("tsdb.vehicle.charge.battery_level 93 host=10.0.0.1", out);
ReportPoint point = out.get(0);
assertEquals("tsdb", point.getTable());
assertEquals("vehicle.charge.battery_level", point.getMetric());
assertEquals(93.0, point.getValue());
assertEquals("10.0.0.1", point.getHost());
}
use of wavefront.report.ReportPoint in project java by wavefrontHQ.
the class GraphiteDecoderTest method testSourcePriority.
@Test
public void testSourcePriority() throws Exception {
List<String> customSourceTags = new ArrayList<String>();
customSourceTags.add("fqdn");
GraphiteDecoder decoder = new GraphiteDecoder(customSourceTags);
List<ReportPoint> out = Lists.newArrayList();
decoder.decodeReportPoints("test 1 source=test host=bar fqdn=foo", out, "customer");
ReportPoint point = out.get(0);
assertEquals("customer", point.getTable());
assertEquals("test", point.getMetric());
assertEquals("test", point.getHost());
assertEquals("bar", point.getAnnotations().get("_host"));
assertEquals("foo", point.getAnnotations().get("fqdn"));
assertEquals(1.0, point.getValue());
}
use of wavefront.report.ReportPoint in project java by wavefrontHQ.
the class GraphiteDecoderTest method testMetricWithAnnotationQuoted.
@Test
public void testMetricWithAnnotationQuoted() throws Exception {
GraphiteDecoder decoder = new GraphiteDecoder(emptyCustomSourceTags);
List<ReportPoint> out = Lists.newArrayList();
decoder.decodeReportPoints("1vehicle.charge.battery_level 93 1234567890.246 host=12345 blah=\"test hello\" " + "\"hello world\"=test", out, "customer");
ReportPoint point = out.get(0);
assertEquals("customer", point.getTable());
assertEquals("1vehicle.charge.battery_level", point.getMetric());
assertEquals("12345", point.getHost());
assertEquals(93.0, point.getValue());
assertEquals(1234567890246L, point.getTimestamp().longValue());
assertEquals("test hello", point.getAnnotations().get("blah"));
assertEquals("test", point.getAnnotations().get("hello world"));
}
use of wavefront.report.ReportPoint in project java by wavefrontHQ.
the class GraphiteDecoderTest method testQuotes.
@Test
public void testQuotes() {
GraphiteDecoder decoder = new GraphiteDecoder(emptyCustomSourceTags);
List<ReportPoint> out = Lists.newArrayList();
decoder.decodeReportPoints("\"1vehicle.charge.'battery_level\" 93 1234567890.246 " + "host=12345 blah=\"test'\\\"hello\" \"hello world\"=test", out, "customer");
ReportPoint point = out.get(0);
assertEquals("customer", point.getTable());
assertEquals("1vehicle.charge.'battery_level", point.getMetric());
assertEquals("12345", point.getHost());
assertEquals(93.0, point.getValue());
assertEquals(1234567890246L, point.getTimestamp().longValue());
assertEquals("test'\"hello", point.getAnnotations().get("blah"));
assertEquals("test", point.getAnnotations().get("hello world"));
}
Aggregations