Search in sources :

Example 26 with ReportPoint

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());
}
Also used : ReportPoint(wavefront.report.ReportPoint) Test(org.junit.Test)

Example 27 with ReportPoint

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());
}
Also used : ReportPoint(wavefront.report.ReportPoint) Test(org.junit.Test)

Example 28 with ReportPoint

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());
}
Also used : ReportPoint(wavefront.report.ReportPoint) Test(org.junit.Test)

Example 29 with ReportPoint

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"));
}
Also used : ReportPoint(wavefront.report.ReportPoint) Test(org.junit.Test)

Example 30 with ReportPoint

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());
}
Also used : ReportPoint(wavefront.report.ReportPoint) Test(org.junit.Test)

Aggregations

ReportPoint (wavefront.report.ReportPoint)71 Test (org.junit.Test)50 ArrayList (java.util.ArrayList)24 Histogram (wavefront.report.Histogram)10 PointHandler (com.wavefront.agent.PointHandler)4 List (java.util.List)4 JsonNode (com.fasterxml.jackson.databind.JsonNode)3 IOException (java.io.IOException)3 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 AgentDigest (com.tdunning.math.stats.AgentDigest)2 InetSocketAddress (java.net.InetSocketAddress)2 HashMap (java.util.HashMap)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 Throwables (com.google.common.base.Throwables)1 ImmutableList (com.google.common.collect.ImmutableList)1 Lists (com.google.common.collect.Lists)1 ObjectQueue (com.squareup.tape.ObjectQueue)1 Validation (com.wavefront.agent.Validation)1 Utils (com.wavefront.agent.histogram.Utils)1 Granularity.fromMillis (com.wavefront.agent.histogram.Utils.Granularity.fromMillis)1