Search in sources :

Example 1 with SimpleStreamState

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

the class SpanGrpcDataSenderProvider method get.

@Override
public DataSender<SpanType> get() {
    final String collectorIp = grpcTransportConfig.getSpanCollectorIp();
    final int collectorPort = grpcTransportConfig.getSpanCollectorPort();
    final boolean sslEnable = grpcTransportConfig.isSpanSslEnable();
    final int senderExecutorQueueSize = grpcTransportConfig.getSpanSenderExecutorQueueSize();
    final ChannelFactoryBuilder channelFactoryBuilder = newChannelFactoryBuilder(sslEnable);
    final ChannelFactory channelFactory = channelFactoryBuilder.build();
    final ReconnectExecutor reconnectExecutor = this.reconnectExecutor.get();
    ClientOption spanClientOption = grpcTransportConfig.getSpanClientOption();
    final StreamState failState = new SimpleStreamState(spanClientOption.getLimitCount(), spanClientOption.getLimitTime());
    logger.info("failState:{}", failState);
    final SpanGrpcDataSender spanGrpcDataSender = new SpanGrpcDataSender(collectorIp, collectorPort, senderExecutorQueueSize, messageConverter, reconnectExecutor, channelFactory, failState);
    registerChannelzReporter(spanGrpcDataSender);
    return spanGrpcDataSender;
}
Also used : SimpleStreamState(com.navercorp.pinpoint.profiler.sender.grpc.SimpleStreamState) StreamState(com.navercorp.pinpoint.profiler.sender.grpc.StreamState) ReconnectExecutor(com.navercorp.pinpoint.profiler.sender.grpc.ReconnectExecutor) SimpleStreamState(com.navercorp.pinpoint.profiler.sender.grpc.SimpleStreamState) ChannelFactory(com.navercorp.pinpoint.grpc.client.ChannelFactory) ClientOption(com.navercorp.pinpoint.grpc.client.config.ClientOption) SpanGrpcDataSender(com.navercorp.pinpoint.profiler.sender.grpc.SpanGrpcDataSender) ChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder)

Aggregations

ChannelFactory (com.navercorp.pinpoint.grpc.client.ChannelFactory)1 ChannelFactoryBuilder (com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder)1 DefaultChannelFactoryBuilder (com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder)1 ClientOption (com.navercorp.pinpoint.grpc.client.config.ClientOption)1 ReconnectExecutor (com.navercorp.pinpoint.profiler.sender.grpc.ReconnectExecutor)1 SimpleStreamState (com.navercorp.pinpoint.profiler.sender.grpc.SimpleStreamState)1 SpanGrpcDataSender (com.navercorp.pinpoint.profiler.sender.grpc.SpanGrpcDataSender)1 StreamState (com.navercorp.pinpoint.profiler.sender.grpc.StreamState)1