Search in sources :

Example 1 with DataSender

use of com.navercorp.pinpoint.profiler.sender.DataSender in project pinpoint by naver.

the class BasePinpointTest method setup.

public void setup(TestContext testContext) {
    MockApplicationContext mockApplicationContext = testContext.getMockApplicationContext();
    DataSender spanDataSender = mockApplicationContext.getSpanDataSender();
    if (spanDataSender instanceof ListenableDataSender) {
        ListenableDataSender listenableDataSender = (ListenableDataSender) spanDataSender;
        final TBaseRecorder tBaseRecord = new TBaseRecorder();
        listenableDataSender.setListener(new ListenableDataSender.Listener() {

            @Override
            public boolean handleSend(TBase<?, ?> data) {
                return tBaseRecord.add(data);
            }
        });
        setTBaseRecorder(tBaseRecord);
    }
    ServerMetaDataHolder serverMetaDataHolder = mockApplicationContext.getTraceContext().getServerMetaDataHolder();
    if (serverMetaDataHolder instanceof ResettableServerMetaDataHolder) {
        ResettableServerMetaDataHolder resettableServerMetaDataHolder = (ResettableServerMetaDataHolder) serverMetaDataHolder;
        this.setServerMetaDataHolder(resettableServerMetaDataHolder);
    }
    this.serverMetaDataHolder.addListener(this.listener);
}
Also used : ResettableServerMetaDataHolder(com.navercorp.pinpoint.test.ResettableServerMetaDataHolder) TBaseRecorder(com.navercorp.pinpoint.test.TBaseRecorder) ListenableDataSender(com.navercorp.pinpoint.test.ListenableDataSender) DataSender(com.navercorp.pinpoint.profiler.sender.DataSender) ResettableServerMetaDataHolder(com.navercorp.pinpoint.test.ResettableServerMetaDataHolder) ServerMetaDataHolder(com.navercorp.pinpoint.bootstrap.context.ServerMetaDataHolder) ListenableDataSender(com.navercorp.pinpoint.test.ListenableDataSender) MockApplicationContext(com.navercorp.pinpoint.test.MockApplicationContext)

Example 2 with DataSender

use of com.navercorp.pinpoint.profiler.sender.DataSender 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 DataSender

use of com.navercorp.pinpoint.profiler.sender.DataSender 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)

Aggregations

ServerMetaDataHolder (com.navercorp.pinpoint.bootstrap.context.ServerMetaDataHolder)3 DataSender (com.navercorp.pinpoint.profiler.sender.DataSender)3 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 EnhancedDataSender (com.navercorp.pinpoint.profiler.sender.EnhancedDataSender)2 PinpointClient (com.navercorp.pinpoint.rpc.client.PinpointClient)2 PinpointClientFactory (com.navercorp.pinpoint.rpc.client.PinpointClientFactory)2 ListenableDataSender (com.navercorp.pinpoint.test.ListenableDataSender)1 MockApplicationContext (com.navercorp.pinpoint.test.MockApplicationContext)1 ResettableServerMetaDataHolder (com.navercorp.pinpoint.test.ResettableServerMetaDataHolder)1 TBaseRecorder (com.navercorp.pinpoint.test.TBaseRecorder)1