use of com.navercorp.pinpoint.profiler.sender.EnhancedDataSender in project pinpoint by naver.
the class AgentInfoSenderProvider method get.
@Override
public AgentInfoSender get() {
final EnhancedDataSender enhancedDataSender = this.enhancedDataSenderProvider.get();
final AgentInformation agentInformation = this.agentInformationProvider.get();
final AgentInfoSender.Builder builder = new AgentInfoSender.Builder(enhancedDataSender, agentInformation, jvmInformation);
builder.sendInterval(profilerConfig.getAgentInfoSendRetryInterval());
return builder.build();
}
use of com.navercorp.pinpoint.profiler.sender.EnhancedDataSender in project pinpoint by naver.
the class PluginApplicationContextModule method configure.
@Override
protected void configure() {
final DataSender spanDataSender = newUdpSpanDataSender();
logger.debug("spanDataSender:{}", spanDataSender);
bind(DataSender.class).annotatedWith(SpanDataSender.class).toInstance(spanDataSender);
final DataSender statDataSender = newUdpStatDataSender();
logger.debug("statDataSender:{}", statDataSender);
bind(DataSender.class).annotatedWith(StatDataSender.class).toInstance(statDataSender);
StorageFactory storageFactory = newStorageFactory(spanDataSender);
logger.debug("spanFactory:{}", spanDataSender);
bind(StorageFactory.class).toInstance(storageFactory);
bind(PinpointClientFactory.class).toProvider(Providers.of((PinpointClientFactory) null));
bind(PinpointClient.class).toProvider(Providers.of((PinpointClient) null));
EnhancedDataSender enhancedDataSender = newTcpDataSender();
logger.debug("enhancedDataSender:{}", enhancedDataSender);
bind(EnhancedDataSender.class).toInstance(enhancedDataSender);
ServerMetaDataHolder serverMetaDataHolder = newServerMetaDataHolder();
logger.debug("serverMetaDataHolder:{}", serverMetaDataHolder);
bind(ServerMetaDataHolder.class).toInstance(serverMetaDataHolder);
}
use of com.navercorp.pinpoint.profiler.sender.EnhancedDataSender in project pinpoint by naver.
the class MockApplicationContextModule method configure.
@Override
protected void configure() {
final DataSender spanDataSender = newUdpSpanDataSender();
logger.debug("spanDataSender:{}", spanDataSender);
bind(DataSender.class).annotatedWith(SpanDataSender.class).toInstance(spanDataSender);
final DataSender statDataSender = newUdpStatDataSender();
logger.debug("statDataSender:{}", statDataSender);
bind(DataSender.class).annotatedWith(StatDataSender.class).toInstance(statDataSender);
StorageFactory storageFactory = newStorageFactory(spanDataSender);
logger.debug("spanFactory:{}", spanDataSender);
bind(StorageFactory.class).toInstance(storageFactory);
bind(PinpointClientFactory.class).toProvider(Providers.of((PinpointClientFactory) null));
bind(PinpointClient.class).toProvider(Providers.of((PinpointClient) null));
EnhancedDataSender enhancedDataSender = newTcpDataSender();
logger.debug("enhancedDataSender:{}", enhancedDataSender);
bind(EnhancedDataSender.class).toInstance(enhancedDataSender);
ServerMetaDataHolder serverMetaDataHolder = newServerMetaDataHolder();
logger.debug("serverMetaDataHolder:{}", serverMetaDataHolder);
bind(ServerMetaDataHolder.class).toInstance(serverMetaDataHolder);
bind(PluginContextLoadResult.class).toProvider(MockPluginContextLoadResultProvider.class).in(Scopes.SINGLETON);
}
use of com.navercorp.pinpoint.profiler.sender.EnhancedDataSender in project pinpoint by naver.
the class DefaultApplicationContext method closeTcpDataSender.
private void closeTcpDataSender() {
final EnhancedDataSender tcpDataSender = this.tcpDataSender;
if (tcpDataSender != null) {
tcpDataSender.stop();
}
final PinpointClient client = this.client;
if (client != null) {
client.close();
}
final PinpointClientFactory clientFactory = this.clientFactory;
if (clientFactory != null) {
clientFactory.release();
}
}
use of com.navercorp.pinpoint.profiler.sender.EnhancedDataSender in project pinpoint by naver.
the class DefaultApiMetaDataServiceTest method cacheApi.
@Test
public void cacheApi() throws Exception {
EnhancedDataSender dataSender = mock(EnhancedDataSender.class);
ApiMetaDataService apiMetaDataService = new DefaultApiMetaDataService("agentId", System.currentTimeMillis(), dataSender);
MethodDescriptor methodDescriptor = new DefaultMethodDescriptor("clazz", "method", null, null);
int first = apiMetaDataService.cacheApi(methodDescriptor);
Assert.assertNotEquals("not exist", first, 0);
verify(dataSender, times(1)).request(any(TBase.class));
int second = apiMetaDataService.cacheApi(methodDescriptor);
Assert.assertEquals("check cache", first, second);
verify(dataSender, times(1)).request(any(TBase.class));
}
Aggregations