Search in sources :

Example 1 with EnhancedDataSender

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();
}
Also used : EnhancedDataSender(com.navercorp.pinpoint.profiler.sender.EnhancedDataSender) AgentInformation(com.navercorp.pinpoint.profiler.AgentInformation) AgentInfoSender(com.navercorp.pinpoint.profiler.AgentInfoSender)

Example 2 with EnhancedDataSender

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);
}
Also used : SpanDataSender(com.navercorp.pinpoint.profiler.context.module.SpanDataSender) StatDataSender(com.navercorp.pinpoint.profiler.context.module.StatDataSender) StorageFactory(com.navercorp.pinpoint.profiler.context.storage.StorageFactory) PinpointClient(com.navercorp.pinpoint.rpc.client.PinpointClient) PinpointClientFactory(com.navercorp.pinpoint.rpc.client.PinpointClientFactory) SpanDataSender(com.navercorp.pinpoint.profiler.context.module.SpanDataSender) StatDataSender(com.navercorp.pinpoint.profiler.context.module.StatDataSender) EnhancedDataSender(com.navercorp.pinpoint.profiler.sender.EnhancedDataSender) DataSender(com.navercorp.pinpoint.profiler.sender.DataSender) EnhancedDataSender(com.navercorp.pinpoint.profiler.sender.EnhancedDataSender) ServerMetaDataHolder(com.navercorp.pinpoint.bootstrap.context.ServerMetaDataHolder)

Example 3 with EnhancedDataSender

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);
}
Also used : SpanDataSender(com.navercorp.pinpoint.profiler.context.module.SpanDataSender) StatDataSender(com.navercorp.pinpoint.profiler.context.module.StatDataSender) StorageFactory(com.navercorp.pinpoint.profiler.context.storage.StorageFactory) PinpointClient(com.navercorp.pinpoint.rpc.client.PinpointClient) PinpointClientFactory(com.navercorp.pinpoint.rpc.client.PinpointClientFactory) SpanDataSender(com.navercorp.pinpoint.profiler.context.module.SpanDataSender) StatDataSender(com.navercorp.pinpoint.profiler.context.module.StatDataSender) EnhancedDataSender(com.navercorp.pinpoint.profiler.sender.EnhancedDataSender) DataSender(com.navercorp.pinpoint.profiler.sender.DataSender) EnhancedDataSender(com.navercorp.pinpoint.profiler.sender.EnhancedDataSender) ServerMetaDataHolder(com.navercorp.pinpoint.bootstrap.context.ServerMetaDataHolder)

Example 4 with EnhancedDataSender

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();
    }
}
Also used : PinpointClient(com.navercorp.pinpoint.rpc.client.PinpointClient) PinpointClientFactory(com.navercorp.pinpoint.rpc.client.PinpointClientFactory) EnhancedDataSender(com.navercorp.pinpoint.profiler.sender.EnhancedDataSender)

Example 5 with EnhancedDataSender

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));
}
Also used : DefaultMethodDescriptor(com.navercorp.pinpoint.profiler.context.DefaultMethodDescriptor) EnhancedDataSender(com.navercorp.pinpoint.profiler.sender.EnhancedDataSender) TBase(org.apache.thrift.TBase) MethodDescriptor(com.navercorp.pinpoint.bootstrap.context.MethodDescriptor) DefaultMethodDescriptor(com.navercorp.pinpoint.profiler.context.DefaultMethodDescriptor) Test(org.junit.Test)

Aggregations

EnhancedDataSender (com.navercorp.pinpoint.profiler.sender.EnhancedDataSender)7 PinpointClient (com.navercorp.pinpoint.rpc.client.PinpointClient)3 PinpointClientFactory (com.navercorp.pinpoint.rpc.client.PinpointClientFactory)3 TBase (org.apache.thrift.TBase)3 Test (org.junit.Test)3 ServerMetaDataHolder (com.navercorp.pinpoint.bootstrap.context.ServerMetaDataHolder)2 SpanDataSender (com.navercorp.pinpoint.profiler.context.module.SpanDataSender)2 StatDataSender (com.navercorp.pinpoint.profiler.context.module.StatDataSender)2 StorageFactory (com.navercorp.pinpoint.profiler.context.storage.StorageFactory)2 DataSender (com.navercorp.pinpoint.profiler.sender.DataSender)2 MethodDescriptor (com.navercorp.pinpoint.bootstrap.context.MethodDescriptor)1 ParsingResult (com.navercorp.pinpoint.bootstrap.context.ParsingResult)1 AgentInfoSender (com.navercorp.pinpoint.profiler.AgentInfoSender)1 AgentInformation (com.navercorp.pinpoint.profiler.AgentInformation)1 DefaultMethodDescriptor (com.navercorp.pinpoint.profiler.context.DefaultMethodDescriptor)1