Search in sources :

Example 1 with ChannelFactoryBuilder

use of com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder 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 ChannelFactoryBuilder

use of com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder 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 ChannelFactoryBuilder

use of com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder 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 ChannelFactoryBuilder

use of com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder 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 ChannelFactoryBuilder

use of com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder 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

ChannelFactoryBuilder (com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder)12 DefaultChannelFactoryBuilder (com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder)12 ClientOption (com.navercorp.pinpoint.grpc.client.config.ClientOption)9 ChannelFactory (com.navercorp.pinpoint.grpc.client.ChannelFactory)6 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 ReconnectExecutor (com.navercorp.pinpoint.profiler.sender.grpc.ReconnectExecutor)3 GeneratedMessageV3 (com.google.protobuf.GeneratedMessageV3)2 DiscardClientInterceptor (com.navercorp.pinpoint.grpc.client.interceptor.DiscardClientInterceptor)2 MetaDataType (com.navercorp.pinpoint.profiler.metadata.MetaDataType)2 Empty (com.google.protobuf.Empty)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