Search in sources :

Example 1 with UdpDataSenderFactory

use of com.navercorp.pinpoint.profiler.sender.UdpDataSenderFactory in project pinpoint by naver.

the class SpanDataSenderProvider method get.

@Override
public DataSender<SpanType> get() {
    if ("TCP".equalsIgnoreCase(transportType)) {
        if ("OIO".equalsIgnoreCase(ioType)) {
            logger.warn("TCP transport not support OIO type.(only support NIO)");
        }
        PinpointClientFactory pinpointClientFactory = clientFactoryProvider.get();
        MessageSerializer<SpanType, byte[]> messageSerializer = new ThriftMessageSerializer<>(messageConverter);
        return new TcpDataSender<>("SpanDataSender", ip, port, pinpointClientFactory, messageSerializer, writeQueueSize);
    } else {
        UdpDataSenderFactory<SpanType> factory = new UdpDataSenderFactory<>(ip, port, UDP_EXECUTOR_NAME, writeQueueSize, timeout, sendBufferSize, messageConverter);
        return factory.create(ioType);
    }
}
Also used : SpanType(com.navercorp.pinpoint.profiler.context.SpanType) ThriftMessageSerializer(com.navercorp.pinpoint.profiler.sender.ThriftMessageSerializer) PinpointClientFactory(com.navercorp.pinpoint.rpc.client.PinpointClientFactory) TcpDataSender(com.navercorp.pinpoint.profiler.sender.TcpDataSender) UdpDataSenderFactory(com.navercorp.pinpoint.profiler.sender.UdpDataSenderFactory)

Example 2 with UdpDataSenderFactory

use of com.navercorp.pinpoint.profiler.sender.UdpDataSenderFactory in project pinpoint by naver.

the class StatDataSenderProvider method get.

@Override
public DataSender<MetricType> get() {
    if ("TCP".equalsIgnoreCase(transportType)) {
        if ("OIO".equalsIgnoreCase(ioType)) {
            logger.warn("TCP transport not support OIO type.(only support NIO)");
        }
        PinpointClientFactory pinpointClientFactory = clientFactoryProvider.get();
        MessageSerializer<MetricType, byte[]> messageSerializer = new ThriftMessageSerializer<>(messageConverter);
        return new TcpDataSender<>("StatDataSender", ip, port, pinpointClientFactory, messageSerializer, writeQueueSize);
    } else {
        UdpDataSenderFactory<MetricType> factory = new UdpDataSenderFactory<>(ip, port, UDP_EXECUTOR_NAME, writeQueueSize, timeout, sendBufferSize, messageConverter);
        return factory.create(ioType);
    }
}
Also used : ThriftMessageSerializer(com.navercorp.pinpoint.profiler.sender.ThriftMessageSerializer) PinpointClientFactory(com.navercorp.pinpoint.rpc.client.PinpointClientFactory) MetricType(com.navercorp.pinpoint.profiler.monitor.metric.MetricType) TcpDataSender(com.navercorp.pinpoint.profiler.sender.TcpDataSender) UdpDataSenderFactory(com.navercorp.pinpoint.profiler.sender.UdpDataSenderFactory)

Aggregations

TcpDataSender (com.navercorp.pinpoint.profiler.sender.TcpDataSender)2 ThriftMessageSerializer (com.navercorp.pinpoint.profiler.sender.ThriftMessageSerializer)2 UdpDataSenderFactory (com.navercorp.pinpoint.profiler.sender.UdpDataSenderFactory)2 PinpointClientFactory (com.navercorp.pinpoint.rpc.client.PinpointClientFactory)2 SpanType (com.navercorp.pinpoint.profiler.context.SpanType)1 MetricType (com.navercorp.pinpoint.profiler.monitor.metric.MetricType)1