use of com.navercorp.pinpoint.profiler.metadata.MetaDataType in project pinpoint by naver.
the class AgentInfoSenderProvider method get.
@Override
public AgentInfoSender get() {
final EnhancedDataSender<MetaDataType> enhancedDataSender = this.enhancedDataSenderProvider.get();
final AgentInfoFactory agentInfoFactory = this.agentInfoFactoryProvider.get();
final AgentInfoSender agentInfoSender = new AgentInfoSender.Builder(enhancedDataSender, agentInfoFactory).sendInterval(contextConfig.getAgentInfoSendRetryInterval()).setMessageConverter(this.messageConverter).build();
serverMetaDataRegistryService.addListener(new ServerMetaDataRegistryService.OnChangeListener() {
@Override
public void onServerMetaDataChange() {
agentInfoSender.refresh();
}
});
return agentInfoSender;
}
use of com.navercorp.pinpoint.profiler.metadata.MetaDataType in project pinpoint by naver.
the class TcpDataSenderProvider method get.
@Override
public EnhancedDataSender<MetaDataType> get() {
PinpointClientFactory clientFactory = clientFactoryProvider.get();
String collectorTcpServerIp = thriftTransportConfig.getCollectorTcpServerIp();
int collectorTcpServerPort = thriftTransportConfig.getCollectorTcpServerPort();
HeaderTBaseSerializer headerTBaseSerializer = tBaseSerializerProvider.get();
MessageSerializer<MetaDataType, byte[]> messageSerializer = new ThriftMessageSerializer<>(messageConverter, headerTBaseSerializer);
return new TcpDataSender<>("Default", collectorTcpServerIp, collectorTcpServerPort, clientFactory, messageSerializer);
}
use of com.navercorp.pinpoint.profiler.metadata.MetaDataType in project pinpoint by naver.
the class PluginApplicationContextModule method configure.
@Override
protected void configure() {
logger.info("configure {}", this.getClass().getSimpleName());
final DataSender<SpanType> spanDataSender = newUdpSpanDataSender();
logger.debug("spanDataSender:{}", spanDataSender);
TypeLiteral<DataSender<SpanType>> spanDataSenderType = new TypeLiteral<DataSender<SpanType>>() {
};
Key<DataSender<SpanType>> spanDataSenderKey = Key.get(spanDataSenderType, SpanDataSender.class);
bind(spanDataSenderKey).toInstance(spanDataSender);
final DataSender<MetricType> statDataSender = newUdpStatDataSender();
logger.debug("statDataSender:{}", statDataSender);
TypeLiteral<DataSender<MetricType>> statDataSenderType = new TypeLiteral<DataSender<MetricType>>() {
};
Key<DataSender<MetricType>> statDataSenderKey = Key.get(statDataSenderType, StatDataSender.class);
bind(statDataSenderKey).toInstance(statDataSender);
bind(StorageFactory.class).to(TestSpanStorageFactory.class);
bind(PinpointClientFactory.class).toProvider(Providers.of((PinpointClientFactory) null));
EnhancedDataSender<MetaDataType> enhancedDataSender = newTcpDataSender();
logger.debug("enhancedDataSender:{}", enhancedDataSender);
TypeLiteral<EnhancedDataSender<MetaDataType>> dataSenderTypeLiteral = new TypeLiteral<EnhancedDataSender<MetaDataType>>() {
};
bind(dataSenderTypeLiteral).toInstance(enhancedDataSender);
ServerMetaDataRegistryService serverMetaDataRegistryService = newServerMetaDataRegistryService();
bind(ServerMetaDataRegistryService.class).toInstance(serverMetaDataRegistryService);
bind(ApiMetaDataService.class).toProvider(MockApiMetaDataServiceProvider.class).in(Scopes.SINGLETON);
}
use of com.navercorp.pinpoint.profiler.metadata.MetaDataType in project pinpoint by naver.
the class NioUdpDataSenderTest method newNioUdpDataSender.
private NioUDPDataSender<MetaDataType> newNioUdpDataSender() {
TransactionIdEncoder encoder = new DefaultTransactionIdEncoder("agentId", 0);
// SpanProcessor<TSpan, TSpanChunk> spanPostProcessor = new SpanProcessorV1();
// MessageConverter<SpanType, TBase<?, ?>> messageConverter = new SpanThriftMessageConverter("appName", "agentId",
// 0, ServiceType.STAND_ALONE.getCode(), encoder, spanPostProcessor);
MessageConverter<MetaDataType, TBase<?, ?>> messageConverter = new MetadataMessageConverter("appName", "agentId", 0);
return new NioUDPDataSender<>("localhost", PORT, "test", 128, 1000, 1024 * 64 * 100, messageConverter);
}
use of com.navercorp.pinpoint.profiler.metadata.MetaDataType in project pinpoint by naver.
the class NioUdpDataSenderTest method sendMessage_getLimit.
private boolean sendMessage_getLimit(MetaDataType metaData, long waitTimeMillis) throws InterruptedException {
final AtomicBoolean limitCounter = new AtomicBoolean(false);
final CountDownLatch latch = new CountDownLatch(1);
NioUDPDataSender<MetaDataType> sender = newNioUdpDataSender();
try {
sender.send(metaData);
latch.await(waitTimeMillis, TimeUnit.MILLISECONDS);
} finally {
sender.stop();
}
return limitCounter.get();
}
Aggregations