Search in sources :

Example 1 with ServerMetaDataRegistryService

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);
}
Also used : 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) MetricType(com.navercorp.pinpoint.profiler.monitor.metric.MetricType) EnhancedDataSender(com.navercorp.pinpoint.profiler.sender.EnhancedDataSender) SpanType(com.navercorp.pinpoint.profiler.context.SpanType) StorageFactory(com.navercorp.pinpoint.profiler.context.storage.StorageFactory) TypeLiteral(com.google.inject.TypeLiteral) PinpointClientFactory(com.navercorp.pinpoint.rpc.client.PinpointClientFactory) MetaDataType(com.navercorp.pinpoint.profiler.metadata.MetaDataType) DefaultServerMetaDataRegistryService(com.navercorp.pinpoint.profiler.context.DefaultServerMetaDataRegistryService) ServerMetaDataRegistryService(com.navercorp.pinpoint.profiler.context.ServerMetaDataRegistryService)

Example 2 with ServerMetaDataRegistryService

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);
}
Also used : DefaultApplicationContext(com.navercorp.pinpoint.profiler.context.module.DefaultApplicationContext) SpanType(com.navercorp.pinpoint.profiler.context.SpanType) TBaseRecorder(com.navercorp.pinpoint.test.TBaseRecorder) ServerMetaDataRegistryService(com.navercorp.pinpoint.profiler.context.ServerMetaDataRegistryService) ListenableDataSender(com.navercorp.pinpoint.test.ListenableDataSender)

Example 3 with 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;
}
Also used : DefaultServerMetaDataRegistryService(com.navercorp.pinpoint.profiler.context.DefaultServerMetaDataRegistryService) DefaultServerMetaDataRegistryService(com.navercorp.pinpoint.profiler.context.DefaultServerMetaDataRegistryService) ServerMetaDataRegistryService(com.navercorp.pinpoint.profiler.context.ServerMetaDataRegistryService)

Example 4 with 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;
}
Also used : DefaultServerMetaDataRegistryService(com.navercorp.pinpoint.profiler.context.DefaultServerMetaDataRegistryService) DefaultServerMetaDataRegistryService(com.navercorp.pinpoint.profiler.context.DefaultServerMetaDataRegistryService) ServerMetaDataRegistryService(com.navercorp.pinpoint.profiler.context.ServerMetaDataRegistryService)

Example 5 with 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);
}
Also used : StorageFactory(com.navercorp.pinpoint.profiler.context.storage.StorageFactory) TraceDataFormatVersion(com.navercorp.pinpoint.profiler.context.TraceDataFormatVersion) DefaultServerMetaDataRegistryService(com.navercorp.pinpoint.profiler.context.DefaultServerMetaDataRegistryService) ServerMetaDataRegistryService(com.navercorp.pinpoint.profiler.context.ServerMetaDataRegistryService) PluginClassLoader(com.navercorp.pinpoint.profiler.context.module.PluginClassLoader) PluginClassLoader(com.navercorp.pinpoint.profiler.context.module.PluginClassLoader)

Aggregations

ServerMetaDataRegistryService (com.navercorp.pinpoint.profiler.context.ServerMetaDataRegistryService)6 DefaultServerMetaDataRegistryService (com.navercorp.pinpoint.profiler.context.DefaultServerMetaDataRegistryService)5 SpanType (com.navercorp.pinpoint.profiler.context.SpanType)2 StorageFactory (com.navercorp.pinpoint.profiler.context.storage.StorageFactory)2 TypeLiteral (com.google.inject.TypeLiteral)1 TraceDataFormatVersion (com.navercorp.pinpoint.profiler.context.TraceDataFormatVersion)1 DefaultApplicationContext (com.navercorp.pinpoint.profiler.context.module.DefaultApplicationContext)1 PluginClassLoader (com.navercorp.pinpoint.profiler.context.module.PluginClassLoader)1 SpanDataSender (com.navercorp.pinpoint.profiler.context.module.SpanDataSender)1 StatDataSender (com.navercorp.pinpoint.profiler.context.module.StatDataSender)1 MetaDataType (com.navercorp.pinpoint.profiler.metadata.MetaDataType)1 MetricType (com.navercorp.pinpoint.profiler.monitor.metric.MetricType)1 DataSender (com.navercorp.pinpoint.profiler.sender.DataSender)1 EnhancedDataSender (com.navercorp.pinpoint.profiler.sender.EnhancedDataSender)1 PinpointClientFactory (com.navercorp.pinpoint.rpc.client.PinpointClientFactory)1 ListenableDataSender (com.navercorp.pinpoint.test.ListenableDataSender)1 TBaseRecorder (com.navercorp.pinpoint.test.TBaseRecorder)1