Search in sources :

Example 71 with ReportPoint

use of wavefront.report.ReportPoint in project java by wavefrontHQ.

the class AccumulationTaskTest method setUp.

@Before
public void setUp() throws Exception {
    AtomicInteger timeMillis = new AtomicInteger(0);
    in = new InMemoryObjectQueue<>();
    out = new ConcurrentHashMap<>();
    cache = new AccumulationCache(out, 0, timeMillis::get);
    badPointsOut = Lists.newArrayList();
    PointHandler pointHandler = new PointHandler() {

        @Override
        public void reportPoint(ReportPoint point, String debugLine) {
            throw new UnsupportedOperationException();
        }

        @Override
        public void reportPoints(List<ReportPoint> points) {
            throw new UnsupportedOperationException();
        }

        @Override
        public void handleBlockedPoint(String pointLine) {
            badPointsOut.add(pointLine);
        }
    };
    eventSubject = new AccumulationTask(in, cache, new GraphiteDecoder("unknown", ImmutableList.of()), pointHandler, Validation.Level.NUMERIC_ONLY, TTL, MINUTE, COMPRESSION);
    histoSubject = new AccumulationTask(in, cache, new HistogramDecoder(), pointHandler, Validation.Level.NUMERIC_ONLY, TTL, MINUTE, COMPRESSION);
}
Also used : AtomicInteger(java.util.concurrent.atomic.AtomicInteger) PointHandler(com.wavefront.agent.PointHandler) List(java.util.List) ImmutableList(com.google.common.collect.ImmutableList) HistogramDecoder(com.wavefront.ingester.HistogramDecoder) ReportPoint(wavefront.report.ReportPoint) GraphiteDecoder(com.wavefront.ingester.GraphiteDecoder) Before(org.junit.Before)

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