use of wavefront.report.ReportPoint in project java by wavefrontHQ.
the class GraphiteDecoderTest method testDecodeWithMillisTimestamp.
@Test
public void testDecodeWithMillisTimestamp() throws Exception {
GraphiteDecoder decoder = new GraphiteDecoder(emptyCustomSourceTags);
List<ReportPoint> out = Lists.newArrayList();
decoder.decodeReportPoints("vehicle.charge.battery_level 93 1234567892468", out, "customer");
ReportPoint point = out.get(0);
assertEquals("customer", point.getTable());
assertEquals("vehicle.charge.battery_level", point.getMetric());
assertEquals(93.0, point.getValue());
assertEquals(1234567892468L, point.getTimestamp().longValue());
}
use of wavefront.report.ReportPoint in project java by wavefrontHQ.
the class GraphiteDecoderTest method testDecodeWithNoCustomerWithNoTagsAndTimestamp.
@Test
public void testDecodeWithNoCustomerWithNoTagsAndTimestamp() throws Exception {
GraphiteDecoder decoder = new GraphiteDecoder(emptyCustomSourceTags);
List<ReportPoint> out = Lists.newArrayList();
decoder.decodeReportPoints("vehicle.charge.battery_level 93 1234567890.246", out, "customer");
ReportPoint point = out.get(0);
assertEquals("customer", point.getTable());
assertEquals("vehicle.charge.battery_level", point.getMetric());
assertEquals(93.0, point.getValue());
assertEquals(1234567890246L, point.getTimestamp().longValue());
}
use of wavefront.report.ReportPoint in project java by wavefrontHQ.
the class GraphiteDecoderTest method testMetricWithNumberStarting.
@Test
public void testMetricWithNumberStarting() throws Exception {
GraphiteDecoder decoder = new GraphiteDecoder(emptyCustomSourceTags);
List<ReportPoint> out = Lists.newArrayList();
decoder.decodeReportPoints("1vehicle.charge.battery_level 93 1234567890.246", out, "customer");
ReportPoint point = out.get(0);
assertEquals("customer", point.getTable());
assertEquals("1vehicle.charge.battery_level", point.getMetric());
assertEquals(93.0, point.getValue());
assertEquals(1234567890246L, point.getTimestamp().longValue());
}
use of wavefront.report.ReportPoint in project java by wavefrontHQ.
the class GraphiteDecoderTest method testQuotedMetric.
@Test
public void testQuotedMetric() 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 testDecodeWithNoCustomerWithTimestamp.
@Test
public void testDecodeWithNoCustomerWithTimestamp() throws Exception {
GraphiteDecoder decoder = new GraphiteDecoder(emptyCustomSourceTags);
List<ReportPoint> out = Lists.newArrayList();
decoder.decodeReportPoints("vehicle.charge.battery_level 93 1234567890.246 host=vehicle_2554", out, "customer");
ReportPoint point = out.get(0);
assertEquals("customer", point.getTable());
assertEquals(1234567890246L, point.getTimestamp().longValue());
assertEquals("vehicle.charge.battery_level", point.getMetric());
assertEquals(93.0, point.getValue());
assertEquals("vehicle_2554", point.getHost());
}
Aggregations