use of com.navercorp.pinpoint.profiler.context.ServerMetaDataRegistryService 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.context.ServerMetaDataRegistryService in project pinpoint by naver.
the class BasePinpointTest method setup.
public void setup(TestContext testContext) {
DefaultApplicationContext mockApplicationContext = testContext.getDefaultApplicationContext();
DataSender<SpanType> spanDataSender = mockApplicationContext.getSpanDataSender();
if (spanDataSender instanceof ListenableDataSender) {
ListenableDataSender<SpanType> listenableDataSender = (ListenableDataSender<SpanType>) spanDataSender;
final TBaseRecorder<SpanType> tBaseRecord = new TBaseRecorder<>();
listenableDataSender.setListener(new ListenableDataSender.Listener<SpanType>() {
@Override
public boolean handleSend(SpanType data) {
return tBaseRecord.add(data);
}
});
setTBaseRecorder(tBaseRecord);
}
ServerMetaDataRegistryService serverMetaDataRegistryService = mockApplicationContext.getServerMetaDataRegistryService();
this.setServerMetaDataRegistryService(serverMetaDataRegistryService);
}
use of com.navercorp.pinpoint.profiler.context.ServerMetaDataRegistryService in project pinpoint by naver.
the class ServerMetaDataRegistryServiceProvider method get.
@Override
public ServerMetaDataRegistryService get() {
List<String> vmArgs = RuntimeMXBeanUtils.getVmArgs();
ServerMetaDataRegistryService serverMetaDataRegistryService = new DefaultServerMetaDataRegistryService(vmArgs);
return serverMetaDataRegistryService;
}
use of com.navercorp.pinpoint.profiler.context.ServerMetaDataRegistryService in project pinpoint by naver.
the class PluginApplicationContextModule method newServerMetaDataRegistryService.
private ServerMetaDataRegistryService newServerMetaDataRegistryService() {
List<String> vmArgs = RuntimeMXBeanUtils.getVmArgs();
ServerMetaDataRegistryService serverMetaDataRegistryService = new DefaultServerMetaDataRegistryService(vmArgs);
return serverMetaDataRegistryService;
}
use of com.navercorp.pinpoint.profiler.context.ServerMetaDataRegistryService in project pinpoint by naver.
the class MockApplicationContextModule method configure.
@Override
protected void configure() {
logger.info("configure {}", this.getClass().getSimpleName());
bind(TraceDataFormatVersion.class).toInstance(TraceDataFormatVersion.V1);
bind(StorageFactory.class).to(TestSpanStorageFactory.class);
ServerMetaDataRegistryService serverMetaDataRegistryService = newServerMetaDataRegistryService();
bind(ServerMetaDataRegistryService.class).toInstance(serverMetaDataRegistryService);
ClassLoader defaultClassLoader = ClassLoaderUtils.getDefaultClassLoader();
bind(ClassLoader.class).annotatedWith(PluginClassLoader.class).toInstance(defaultClassLoader);
bind(PluginSetup.class).toProvider(MockPluginSetupProvider.class).in(Scopes.SINGLETON);
bind(ProfilerPluginContextLoader.class).toProvider(MockProfilerPluginContextLoaderProvider.class).in(Scopes.SINGLETON);
bind(PluginContextLoadResult.class).toProvider(MockPluginContextLoadResultProvider.class).in(Scopes.SINGLETON);
}
Aggregations