Search in sources :

Example 1 with ReportPointDecoder

use of com.wavefront.ingester.ReportPointDecoder in project java by wavefrontHQ.

the class InteractivePreprocessorTester method interactiveTest.

@Override
public boolean interactiveTest() {
    String line = stdin.nextLine();
    if (entityType == ReportableEntityType.TRACE) {
        ReportableEntityHandler<Span, String> handler = factory.getHandler(entityType, port);
        SpanUtils.preprocessAndHandleSpan(line, SPAN_DECODER, handler, handler::report, preprocessorSupplier, null, x -> true);
    } else {
        ReportableEntityHandler<ReportPoint, String> handler = factory.getHandler(entityType, port);
        ReportableEntityDecoder<String, ReportPoint> decoder;
        if (DataFormat.autodetect(line) == DataFormat.HISTOGRAM) {
            decoder = new ReportPointDecoderWrapper(new HistogramDecoder());
        } else {
            decoder = new ReportPointDecoder(() -> "unknown", customSourceTags);
        }
        WavefrontPortUnificationHandler.preprocessAndHandlePoint(line, decoder, handler, preprocessorSupplier, null, "");
    }
    return stdin.hasNext();
}
Also used : ReportPointDecoder(com.wavefront.ingester.ReportPointDecoder) ReportPointDecoderWrapper(com.wavefront.ingester.ReportPointDecoderWrapper) HistogramDecoder(com.wavefront.ingester.HistogramDecoder) Span(wavefront.report.Span) ReportPoint(wavefront.report.ReportPoint)

Aggregations

HistogramDecoder (com.wavefront.ingester.HistogramDecoder)1 ReportPointDecoder (com.wavefront.ingester.ReportPointDecoder)1 ReportPointDecoderWrapper (com.wavefront.ingester.ReportPointDecoderWrapper)1 ReportPoint (wavefront.report.ReportPoint)1 Span (wavefront.report.Span)1