Search in sources :

Example 1 with ClientOption

use of com.navercorp.pinpoint.grpc.client.config.ClientOption in project pinpoint by naver.

the class MetadataClientMock method newChannelFactory.

private ChannelFactory newChannelFactory() {
    HeaderFactory headerFactory = new AgentHeaderFactory("mockAgentId", "mockAgentName", "mockApplicationName", ServiceType.UNDEFINED.getCode(), System.currentTimeMillis());
    ChannelFactoryBuilder channelFactoryBuilder = new DefaultChannelFactoryBuilder("MetadataClientMock");
    channelFactoryBuilder.setHeaderFactory(headerFactory);
    channelFactoryBuilder.setClientOption(new ClientOption());
    return channelFactoryBuilder.build();
}
Also used : HeaderFactory(com.navercorp.pinpoint.grpc.client.HeaderFactory) AgentHeaderFactory(com.navercorp.pinpoint.grpc.AgentHeaderFactory) ClientOption(com.navercorp.pinpoint.grpc.client.config.ClientOption) AgentHeaderFactory(com.navercorp.pinpoint.grpc.AgentHeaderFactory) ChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder)

Example 2 with ClientOption

use of com.navercorp.pinpoint.grpc.client.config.ClientOption in project pinpoint by naver.

the class SpanClientMock method newChannelFactory.

private ChannelFactory newChannelFactory() {
    HeaderFactory headerFactory = new AgentHeaderFactory("mockAgentId", "mockAgentName", "mockApplicationName", ServiceType.UNDEFINED.getCode(), System.currentTimeMillis());
    ChannelFactoryBuilder channelFactoryBuilder = new DefaultChannelFactoryBuilder("SpanClientMock");
    final ClientInterceptor unaryCallDeadlineInterceptor = new UnaryCallDeadlineInterceptor(1000);
    channelFactoryBuilder.addClientInterceptor(unaryCallDeadlineInterceptor);
    final ClientInterceptor discardClientInterceptor = newDiscardClientInterceptor();
    channelFactoryBuilder.addClientInterceptor(discardClientInterceptor);
    channelFactoryBuilder.setHeaderFactory(headerFactory);
    channelFactoryBuilder.setClientOption(new ClientOption());
    return channelFactoryBuilder.build();
}
Also used : UnaryCallDeadlineInterceptor(com.navercorp.pinpoint.grpc.client.UnaryCallDeadlineInterceptor) DiscardClientInterceptor(com.navercorp.pinpoint.grpc.client.interceptor.DiscardClientInterceptor) ClientInterceptor(io.grpc.ClientInterceptor) HeaderFactory(com.navercorp.pinpoint.grpc.client.HeaderFactory) AgentHeaderFactory(com.navercorp.pinpoint.grpc.AgentHeaderFactory) ClientOption(com.navercorp.pinpoint.grpc.client.config.ClientOption) AgentHeaderFactory(com.navercorp.pinpoint.grpc.AgentHeaderFactory) ChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder)

Example 3 with ClientOption

use of com.navercorp.pinpoint.grpc.client.config.ClientOption in project pinpoint by naver.

the class AgentGrpcDataSenderProvider method newChannelFactoryBuilder.

ChannelFactoryBuilder newChannelFactoryBuilder(boolean sslEnable) {
    final int channelExecutorQueueSize = grpcTransportConfig.getAgentChannelExecutorQueueSize();
    final UnaryCallDeadlineInterceptor unaryCallDeadlineInterceptor = new UnaryCallDeadlineInterceptor(grpcTransportConfig.getAgentRequestTimeout());
    final ClientOption clientOption = grpcTransportConfig.getAgentClientOption();
    ChannelFactoryBuilder channelFactoryBuilder = new DefaultChannelFactoryBuilder("AgentGrpcDataSender");
    channelFactoryBuilder.setHeaderFactory(headerFactory);
    channelFactoryBuilder.setNameResolverProvider(nameResolverProvider);
    channelFactoryBuilder.addClientInterceptor(unaryCallDeadlineInterceptor);
    if (clientInterceptorList != null) {
        for (ClientInterceptor clientInterceptor : clientInterceptorList) {
            logger.info("addClientInterceptor:{}", clientInterceptor);
            channelFactoryBuilder.addClientInterceptor(clientInterceptor);
        }
    }
    channelFactoryBuilder.setExecutorQueueSize(channelExecutorQueueSize);
    channelFactoryBuilder.setClientOption(clientOption);
    if (sslEnable) {
        SslOption sslOption = grpcTransportConfig.getSslOption();
        channelFactoryBuilder.setSslOption(sslOption);
    }
    return channelFactoryBuilder;
}
Also used : UnaryCallDeadlineInterceptor(com.navercorp.pinpoint.grpc.client.UnaryCallDeadlineInterceptor) SslOption(com.navercorp.pinpoint.grpc.client.config.SslOption) ClientInterceptor(io.grpc.ClientInterceptor) ClientOption(com.navercorp.pinpoint.grpc.client.config.ClientOption) ChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder)

Example 4 with ClientOption

use of com.navercorp.pinpoint.grpc.client.config.ClientOption in project pinpoint by naver.

the class MetadataGrpcDataSenderProvider method newChannelFactoryBuilder.

protected ChannelFactoryBuilder newChannelFactoryBuilder(boolean sslEnable) {
    final int channelExecutorQueueSize = grpcTransportConfig.getMetadataChannelExecutorQueueSize();
    final UnaryCallDeadlineInterceptor unaryCallDeadlineInterceptor = new UnaryCallDeadlineInterceptor(grpcTransportConfig.getMetadataRequestTimeout());
    final ClientOption clientOption = grpcTransportConfig.getMetadataClientOption();
    ChannelFactoryBuilder channelFactoryBuilder = new DefaultChannelFactoryBuilder("MetadataGrpcDataSender");
    channelFactoryBuilder.setHeaderFactory(headerFactory);
    channelFactoryBuilder.setNameResolverProvider(nameResolverProvider);
    channelFactoryBuilder.addClientInterceptor(unaryCallDeadlineInterceptor);
    if (clientInterceptorList != null) {
        for (ClientInterceptor clientInterceptor : clientInterceptorList) {
            logger.info("addClientInterceptor:{}", clientInterceptor);
            channelFactoryBuilder.addClientInterceptor(clientInterceptor);
        }
    }
    channelFactoryBuilder.setExecutorQueueSize(channelExecutorQueueSize);
    channelFactoryBuilder.setClientOption(clientOption);
    if (sslEnable) {
        SslOption sslOption = grpcTransportConfig.getSslOption();
        channelFactoryBuilder.setSslOption(sslOption);
    }
    return channelFactoryBuilder;
}
Also used : UnaryCallDeadlineInterceptor(com.navercorp.pinpoint.grpc.client.UnaryCallDeadlineInterceptor) SslOption(com.navercorp.pinpoint.grpc.client.config.SslOption) ClientInterceptor(io.grpc.ClientInterceptor) ClientOption(com.navercorp.pinpoint.grpc.client.config.ClientOption) ChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder)

Example 5 with ClientOption

use of com.navercorp.pinpoint.grpc.client.config.ClientOption in project pinpoint by naver.

the class StatGrpcDataSenderProvider method newChannelFactoryBuilder.

private ChannelFactoryBuilder newChannelFactoryBuilder(boolean sslEnable) {
    final int channelExecutorQueueSize = grpcTransportConfig.getStatChannelExecutorQueueSize();
    final UnaryCallDeadlineInterceptor unaryCallDeadlineInterceptor = new UnaryCallDeadlineInterceptor(grpcTransportConfig.getStatRequestTimeout());
    final ClientOption clientOption = grpcTransportConfig.getStatClientOption();
    ChannelFactoryBuilder channelFactoryBuilder = new DefaultChannelFactoryBuilder("StatGrpcDataSender");
    channelFactoryBuilder.setHeaderFactory(headerFactory);
    channelFactoryBuilder.setNameResolverProvider(nameResolverProvider);
    channelFactoryBuilder.addClientInterceptor(unaryCallDeadlineInterceptor);
    if (clientInterceptorList != null) {
        for (ClientInterceptor clientInterceptor : clientInterceptorList) {
            logger.info("addClientInterceptor:{}", clientInterceptor);
            channelFactoryBuilder.addClientInterceptor(clientInterceptor);
        }
    }
    channelFactoryBuilder.setExecutorQueueSize(channelExecutorQueueSize);
    channelFactoryBuilder.setClientOption(clientOption);
    if (sslEnable) {
        SslOption sslOption = grpcTransportConfig.getSslOption();
        channelFactoryBuilder.setSslOption(sslOption);
    }
    return channelFactoryBuilder;
}
Also used : UnaryCallDeadlineInterceptor(com.navercorp.pinpoint.grpc.client.UnaryCallDeadlineInterceptor) SslOption(com.navercorp.pinpoint.grpc.client.config.SslOption) ClientInterceptor(io.grpc.ClientInterceptor) ClientOption(com.navercorp.pinpoint.grpc.client.config.ClientOption) ChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder) DefaultChannelFactoryBuilder(com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder)

Aggregations

ClientOption (com.navercorp.pinpoint.grpc.client.config.ClientOption)10 ChannelFactoryBuilder (com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder)9 DefaultChannelFactoryBuilder (com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder)9 UnaryCallDeadlineInterceptor (com.navercorp.pinpoint.grpc.client.UnaryCallDeadlineInterceptor)5 ClientInterceptor (io.grpc.ClientInterceptor)5 HeaderFactory (com.navercorp.pinpoint.grpc.client.HeaderFactory)4 SslOption (com.navercorp.pinpoint.grpc.client.config.SslOption)4 AgentHeaderFactory (com.navercorp.pinpoint.grpc.AgentHeaderFactory)3 ChannelFactory (com.navercorp.pinpoint.grpc.client.ChannelFactory)3 DiscardClientInterceptor (com.navercorp.pinpoint.grpc.client.interceptor.DiscardClientInterceptor)2 Empty (com.google.protobuf.Empty)1 GeneratedMessageV3 (com.google.protobuf.GeneratedMessageV3)1 ValueAnnotationProcessor (com.navercorp.pinpoint.bootstrap.config.util.ValueAnnotationProcessor)1 PropertyPlaceholderHelper (com.navercorp.pinpoint.bootstrap.util.spring.PropertyPlaceholderHelper)1 PSpan (com.navercorp.pinpoint.grpc.trace.PSpan)1 PSpanMessage (com.navercorp.pinpoint.grpc.trace.PSpanMessage)1 SpanGrpc (com.navercorp.pinpoint.grpc.trace.SpanGrpc)1 GrpcMetadataMessageConverter (com.navercorp.pinpoint.profiler.context.grpc.GrpcMetadataMessageConverter)1 DnsExecutorServiceProvider (com.navercorp.pinpoint.profiler.context.provider.grpc.DnsExecutorServiceProvider)1 GrpcNameResolverProvider (com.navercorp.pinpoint.profiler.context.provider.grpc.GrpcNameResolverProvider)1