use of com.wavefront.ingester.ReportPointDecoderWrapper 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();
}
use of com.wavefront.ingester.ReportPointDecoderWrapper in project java by wavefrontHQ.
the class PushAgent method startOpenTsdbListener.
protected void startOpenTsdbListener(final String strPort, ReportableEntityHandlerFactory handlerFactory) {
int port = Integer.parseInt(strPort);
registerPrefixFilter(strPort);
registerTimestampFilter(strPort);
if (proxyConfig.isHttpHealthCheckAllPorts())
healthCheckManager.enableHealthcheck(port);
ReportableEntityDecoder<String, ReportPoint> openTSDBDecoder = new ReportPointDecoderWrapper(new OpenTSDBDecoder("unknown", proxyConfig.getCustomSourceTags()));
ChannelHandler channelHandler = new OpenTSDBPortUnificationHandler(strPort, tokenAuthenticator, healthCheckManager, openTSDBDecoder, handlerFactory, preprocessors.get(strPort), hostnameResolver);
startAsManagedThread(port, new TcpIngester(createInitializer(channelHandler, port, proxyConfig.getPushListenerMaxReceivedLength(), proxyConfig.getPushListenerHttpBufferSize(), proxyConfig.getListenerIdleConnectionTimeout(), getSslContext(strPort), getCorsConfig(strPort)), port).withChildChannelOptions(childChannelOptions), "listener-plaintext-opentsdb-" + port);
logger.info("listening on port: " + strPort + " for OpenTSDB metrics");
}
Aggregations