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