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();
}
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();
}
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;
}
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;
}
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;
}
Aggregations