Search in sources :

Example 1 with ReconnectExecutor

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

the class AgentGrpcDataSenderProvider method get.

@Override
public EnhancedDataSender<MetaDataType> get() {
    final String collectorIp = grpcTransportConfig.getAgentCollectorIp();
    final int collectorPort = grpcTransportConfig.getAgentCollectorPort();
    final boolean sslEnable = grpcTransportConfig.isAgentSslEnable();
    final int senderExecutorQueueSize = grpcTransportConfig.getAgentSenderExecutorQueueSize();
    final ChannelFactoryBuilder channelFactoryBuilder = newChannelFactoryBuilder(sslEnable);
    ChannelFactory channelFactory = channelFactoryBuilder.build();
    final ReconnectExecutor reconnectExecutor = reconnectExecutorProvider.get();
    final ProfilerCommandServiceLocator profilerCommandServiceLocator = createProfilerCommandServiceLocator(activeTraceRepository);
    MessageConverter<MetaDataType, GeneratedMessageV3> messageConverter = this.messageConverter;
    return newAgentGrpcDataSender(collectorIp, collectorPort, senderExecutorQueueSize, messageConverter, channelFactory, reconnectExecutor, retransmissionExecutor, profilerCommandServiceLocator);
}
Also used : ReconnectExecutor(com.navercorp.pinpoint.profiler.sender.grpc.ReconnectExecutor) MetaDataType(com.navercorp.pinpoint.profiler.metadata.MetaDataType) ChannelFactory(com.navercorp.pinpoint.grpc.client.ChannelFactory) ProfilerCommandServiceLocator(com.navercorp.pinpoint.profiler.receiver.ProfilerCommandServiceLocator) GeneratedMessageV3(com.google.protobuf.GeneratedMessageV3) ChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder)

Example 2 with ReconnectExecutor

use of com.navercorp.pinpoint.profiler.sender.grpc.ReconnectExecutor 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)

Example 3 with ReconnectExecutor

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

the class StatGrpcDataSenderProvider method get.

@Override
public DataSender<MetricType> get() {
    final String collectorIp = grpcTransportConfig.getStatCollectorIp();
    final int collectorPort = grpcTransportConfig.getStatCollectorPort();
    final boolean sslEnable = grpcTransportConfig.isStatSslEnable();
    final int senderExecutorQueueSize = grpcTransportConfig.getStatSenderExecutorQueueSize();
    final ChannelFactoryBuilder channelFactoryBuilder = newChannelFactoryBuilder(sslEnable);
    final ChannelFactory channelFactory = channelFactoryBuilder.build();
    // not singleton
    ReconnectExecutor reconnectExecutor = reconnectExecutorProvider.get();
    return new StatGrpcDataSender(collectorIp, collectorPort, senderExecutorQueueSize, messageConverter, reconnectExecutor, channelFactory);
}
Also used : StatGrpcDataSender(com.navercorp.pinpoint.profiler.sender.grpc.StatGrpcDataSender) ReconnectExecutor(com.navercorp.pinpoint.profiler.sender.grpc.ReconnectExecutor) ChannelFactory(com.navercorp.pinpoint.grpc.client.ChannelFactory) ChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder)

Aggregations

ChannelFactory (com.navercorp.pinpoint.grpc.client.ChannelFactory)3 ChannelFactoryBuilder (com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder)3 DefaultChannelFactoryBuilder (com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder)3 ReconnectExecutor (com.navercorp.pinpoint.profiler.sender.grpc.ReconnectExecutor)3 GeneratedMessageV3 (com.google.protobuf.GeneratedMessageV3)1 ClientOption (com.navercorp.pinpoint.grpc.client.config.ClientOption)1 MetaDataType (com.navercorp.pinpoint.profiler.metadata.MetaDataType)1 ProfilerCommandServiceLocator (com.navercorp.pinpoint.profiler.receiver.ProfilerCommandServiceLocator)1 SimpleStreamState (com.navercorp.pinpoint.profiler.sender.grpc.SimpleStreamState)1 SpanGrpcDataSender (com.navercorp.pinpoint.profiler.sender.grpc.SpanGrpcDataSender)1 StatGrpcDataSender (com.navercorp.pinpoint.profiler.sender.grpc.StatGrpcDataSender)1 StreamState (com.navercorp.pinpoint.profiler.sender.grpc.StreamState)1