Search in sources :

Example 1 with ProfilerService

use of com.newrelic.agent.profile.ProfilerService in project newrelic-java-agent by newrelic.

the class RPMServiceTest method createServiceManager.

private void createServiceManager(AgentConfig config, Map<String, Object> localSettings) {
    MockServiceManager serviceManager = new MockServiceManager();
    ServiceFactory.setServiceManager(serviceManager);
    ThreadService threadService = new ThreadService();
    serviceManager.setThreadService(threadService);
    ConfigService configService = ConfigServiceFactory.createConfigService(config, localSettings);
    serviceManager.setConfigService(configService);
    HarvestService harvestService = new MockHarvestService();
    serviceManager.setHarvestService(harvestService);
    TransactionService transactionService = new TransactionService();
    serviceManager.setTransactionService(transactionService);
    TransactionTraceService transactionTraceService = new TransactionTraceService();
    serviceManager.setTransactionTraceService(transactionTraceService);
    DatabaseService dbService = new DatabaseService();
    serviceManager.setDatabaseService(dbService);
    SqlTraceService sqlTraceService = new SqlTraceServiceImpl();
    serviceManager.setSqlTraceService(sqlTraceService);
    RPMConnectionService rpmConnectionService = new RPMConnectionServiceImpl();
    serviceManager.setRPMConnectionService(rpmConnectionService);
    ProfilerService profilerService = new ProfilerService();
    serviceManager.setProfilerService(profilerService);
    StatsService statsService = new StatsServiceImpl();
    serviceManager.setStatsService(statsService);
    EnvironmentService envService = new EnvironmentServiceImpl();
    serviceManager.setEnvironmentService(envService);
    MockRPMServiceManager rpmServiceManager = new MockRPMServiceManager();
    serviceManager.setRPMServiceManager(rpmServiceManager);
    AttributesService attService = new AttributesService();
    serviceManager.setAttributesService(attService);
    UtilizationService utilService = new UtilizationService();
    serviceManager.setUtilizationService(utilService);
    TransactionDataToDistributedTraceIntrinsics transactionDataToDistributedTraceIntrinsics = mock(TransactionDataToDistributedTraceIntrinsics.class);
    when(transactionDataToDistributedTraceIntrinsics.buildDistributedTracingIntrinsics(any(TransactionData.class), anyBoolean())).thenReturn(Collections.<String, Object>emptyMap());
    TransactionEventsService transactionEventsService = new TransactionEventsService(transactionDataToDistributedTraceIntrinsics);
    serviceManager.setTransactionEventsService(transactionEventsService);
    serviceManager.setSpansEventService(mock(SpanEventsServiceImpl.class));
}
Also used : SqlTraceServiceImpl(com.newrelic.agent.sql.SqlTraceServiceImpl) UtilizationService(com.newrelic.agent.utilization.UtilizationService) RPMConnectionService(com.newrelic.agent.rpm.RPMConnectionService) StatsService(com.newrelic.agent.stats.StatsService) AttributesService(com.newrelic.agent.attributes.AttributesService) DatabaseService(com.newrelic.agent.database.DatabaseService) TransactionTraceService(com.newrelic.agent.trace.TransactionTraceService) TransactionDataToDistributedTraceIntrinsics(com.newrelic.agent.service.analytics.TransactionDataToDistributedTraceIntrinsics) SqlTraceService(com.newrelic.agent.sql.SqlTraceService) ConfigService(com.newrelic.agent.config.ConfigService) RPMConnectionServiceImpl(com.newrelic.agent.rpm.RPMConnectionServiceImpl) SpanEventsServiceImpl(com.newrelic.agent.service.analytics.SpanEventsServiceImpl) EnvironmentServiceImpl(com.newrelic.agent.environment.EnvironmentServiceImpl) StatsServiceImpl(com.newrelic.agent.stats.StatsServiceImpl) TransactionEventsService(com.newrelic.agent.service.analytics.TransactionEventsService) EnvironmentService(com.newrelic.agent.environment.EnvironmentService) ProfilerService(com.newrelic.agent.profile.ProfilerService)

Example 2 with ProfilerService

use of com.newrelic.agent.profile.ProfilerService in project newrelic-java-agent by newrelic.

the class CommandParserTest method createServiceManager.

private MockServiceManager createServiceManager(Map<String, Object> config) throws Exception {
    MockServiceManager serviceManager = new MockServiceManager();
    ServiceFactory.setServiceManager(serviceManager);
    ThreadService threadService = new ThreadService();
    serviceManager.setThreadService(threadService);
    ConfigService configService = ConfigServiceFactory.createConfigService(AgentConfigImpl.createAgentConfig(config), config);
    serviceManager.setConfigService(configService);
    TransactionService transactionService = new TransactionService();
    serviceManager.setTransactionService(transactionService);
    TransactionTraceService transactionTraceService = new TransactionTraceService();
    serviceManager.setTransactionTraceService(transactionTraceService);
    RPMConnectionService rpmConnectionService = new RPMConnectionServiceImpl();
    serviceManager.setRPMConnectionService(rpmConnectionService);
    ProfilerService profilerService = new ProfilerService();
    serviceManager.setProfilerService(profilerService);
    EnvironmentService envService = new EnvironmentServiceImpl();
    serviceManager.setEnvironmentService(envService);
    HarvestService harvestService = new HarvestServiceImpl();
    serviceManager.setHarvestService(harvestService);
    return serviceManager;
}
Also used : ThreadService(com.newrelic.agent.ThreadService) ConfigService(com.newrelic.agent.config.ConfigService) TransactionService(com.newrelic.agent.TransactionService) RPMConnectionServiceImpl(com.newrelic.agent.rpm.RPMConnectionServiceImpl) HarvestService(com.newrelic.agent.HarvestService) RPMConnectionService(com.newrelic.agent.rpm.RPMConnectionService) EnvironmentServiceImpl(com.newrelic.agent.environment.EnvironmentServiceImpl) MockServiceManager(com.newrelic.agent.MockServiceManager) HarvestServiceImpl(com.newrelic.agent.HarvestServiceImpl) EnvironmentService(com.newrelic.agent.environment.EnvironmentService) ProfilerService(com.newrelic.agent.profile.ProfilerService) TransactionTraceService(com.newrelic.agent.trace.TransactionTraceService)

Example 3 with ProfilerService

use of com.newrelic.agent.profile.ProfilerService in project newrelic-java-agent by newrelic.

the class CommandParserThreadProfilerTest method createServiceManager.

private MockServiceManager createServiceManager(Map<String, Object> config) throws Exception {
    MockServiceManager serviceManager = new MockServiceManager();
    ServiceFactory.setServiceManager(serviceManager);
    ThreadService threadService = new ThreadService();
    serviceManager.setThreadService(threadService);
    ConfigService configService = ConfigServiceFactory.createConfigService(AgentConfigImpl.createAgentConfig(config), config);
    serviceManager.setConfigService(configService);
    TransactionService transactionService = new TransactionService();
    serviceManager.setTransactionService(transactionService);
    TransactionTraceService transactionTraceService = new TransactionTraceService();
    serviceManager.setTransactionTraceService(transactionTraceService);
    RPMConnectionService rpmConnectionService = new RPMConnectionServiceImpl();
    serviceManager.setRPMConnectionService(rpmConnectionService);
    ProfilerService profilerService = new ProfilerService();
    serviceManager.setProfilerService(profilerService);
    EnvironmentService envService = new EnvironmentServiceImpl();
    serviceManager.setEnvironmentService(envService);
    HarvestService harvestService = new HarvestServiceImpl();
    serviceManager.setHarvestService(harvestService);
    return serviceManager;
}
Also used : ThreadService(com.newrelic.agent.ThreadService) ConfigService(com.newrelic.agent.config.ConfigService) TransactionService(com.newrelic.agent.TransactionService) RPMConnectionServiceImpl(com.newrelic.agent.rpm.RPMConnectionServiceImpl) HarvestService(com.newrelic.agent.HarvestService) RPMConnectionService(com.newrelic.agent.rpm.RPMConnectionService) EnvironmentServiceImpl(com.newrelic.agent.environment.EnvironmentServiceImpl) MockServiceManager(com.newrelic.agent.MockServiceManager) HarvestServiceImpl(com.newrelic.agent.HarvestServiceImpl) EnvironmentService(com.newrelic.agent.environment.EnvironmentService) ProfilerService(com.newrelic.agent.profile.ProfilerService) TransactionTraceService(com.newrelic.agent.trace.TransactionTraceService)

Example 4 with ProfilerService

use of com.newrelic.agent.profile.ProfilerService in project newrelic-java-agent by newrelic.

the class IntrospectorServiceManager method setup.

private void setup(Map<String, Object> config) {
    configService = ConfigServiceFactory.createConfigService(AgentConfigImpl.createAgentConfig(config), Collections.<String, Object>emptyMap());
    ServiceFactory.setServiceManager(this);
    coreService = new IntrospectorCoreService();
    threadService = new ThreadService();
    environmentService = new EnvironmentServiceImpl();
    transactionService = new TransactionService();
    rpmConnectionService = new IntrospectorRPMConnectService();
    rpmServiceManager = new IntrospectorRPMServiceManager();
    transactionTraceService = new IntrospectorTransactionTraceService();
    asyncTxService = new AsyncTransactionService();
    profilerService = new ProfilerService();
    statsService = new IntrospectorStatsService();
    harvestService = new IntrospectorHarvestService();
    sqlTraceService = new SqlTraceServiceImpl();
    insightsService = new IntrospectorInsightsService();
    logSenderService = new IntrospectorLogSenderService();
    expirationService = new ExpirationService();
    dbService = new DatabaseService();
    jarCollectorService = new IgnoringJarCollectorService();
    distributedTraceService = new DistributedTraceServiceImpl();
    TransactionDataToDistributedTraceIntrinsics transactionDataToDistributedTraceIntrinsics = new TransactionDataToDistributedTraceIntrinsics(distributedTraceService);
    transactionEventsService = new TransactionEventsService(transactionDataToDistributedTraceIntrinsics);
    normalizationService = new NormalizationServiceImpl();
    extensionService = new ExtensionService(configService, ExtensionsLoadedListener.NOOP);
    tracerService = new TracerService();
    commandParser = new CommandParser();
    remoteInstrumentationService = new RemoteInstrumentationServiceImpl();
    sourceLanguageService = new SourceLanguageService();
    classTransformerService = new NoOpClassTransformerService();
    jmxService = new JmxService(configService.getDefaultAgentConfig().getJmxConfig());
    attributesService = new AttributesService();
    circuitBreakerService = new CircuitBreakerService();
    AgentConfig agentConfig = createAgentConfig(config, (Map) config.get("distributed_tracing"));
    distributedTraceService.connected(null, agentConfig);
    ReservoirManager<SpanEvent> reservoirManager = new CollectorSpanEventReservoirManager(configService);
    ReservoirManager.EventSender<SpanEvent> collectorSender = new CollectorSpanEventSender(rpmServiceManager);
    Consumer<SpanEvent> infiniteTracing = new Consumer<SpanEvent>() {

        @Override
        public void accept(SpanEvent spanEvent) {
        }
    };
    SpanEventCreationDecider spanEventCreationDecider = new SpanEventCreationDecider(configService);
    spanEventsService = new IntrospectorSpanEventService(agentConfig, reservoirManager, collectorSender, infiniteTracing, spanEventCreationDecider, environmentService, transactionDataToDistributedTraceIntrinsics);
    configService.addIAgentConfigListener((IntrospectorSpanEventService) spanEventsService);
    transactionService.addTransactionListener((IntrospectorSpanEventService) spanEventsService);
    try {
        transactionTraceService.start();
        transactionEventsService.start();
        transactionService.start();
    } catch (Exception e) {
    // fall through
    }
}
Also used : ReservoirManager(com.newrelic.agent.interfaces.ReservoirManager) CommandParser(com.newrelic.agent.commands.CommandParser) Consumer(com.newrelic.agent.interfaces.backport.Consumer) ProfilerService(com.newrelic.agent.profile.ProfilerService) CircuitBreakerService(com.newrelic.agent.circuitbreaker.CircuitBreakerService) NormalizationServiceImpl(com.newrelic.agent.normalization.NormalizationServiceImpl) ExtensionService(com.newrelic.agent.extension.ExtensionService) RemoteInstrumentationServiceImpl(com.newrelic.agent.reinstrument.RemoteInstrumentationServiceImpl) SqlTraceServiceImpl(com.newrelic.agent.sql.SqlTraceServiceImpl) AsyncTransactionService(com.newrelic.agent.service.async.AsyncTransactionService) DistributedTraceServiceImpl(com.newrelic.agent.tracing.DistributedTraceServiceImpl) JmxService(com.newrelic.agent.jmx.JmxService) AttributesService(com.newrelic.agent.attributes.AttributesService) AsyncTransactionService(com.newrelic.agent.service.async.AsyncTransactionService) DatabaseService(com.newrelic.agent.database.DatabaseService) EnvironmentServiceImpl(com.newrelic.agent.environment.EnvironmentServiceImpl) SpanEvent(com.newrelic.agent.model.SpanEvent) SourceLanguageService(com.newrelic.agent.language.SourceLanguageService)

Example 5 with ProfilerService

use of com.newrelic.agent.profile.ProfilerService in project newrelic-java-agent by newrelic.

the class CPUSamplerTest method createServiceManager.

private MockServiceManager createServiceManager(Map<String, Object> map) throws Exception {
    MockServiceManager serviceManager = new MockServiceManager();
    ServiceFactory.setServiceManager(serviceManager);
    ThreadService threadService = new ThreadService();
    serviceManager.setThreadService(threadService);
    ConfigService configService = ConfigServiceFactory.createConfigService(AgentConfigImpl.createAgentConfig(map), map);
    serviceManager.setConfigService(configService);
    TransactionService transactionService = new TransactionService();
    serviceManager.setTransactionService(transactionService);
    ProfilerService profilerService = new ProfilerService();
    serviceManager.setProfilerService(profilerService);
    return serviceManager;
}
Also used : ThreadService(com.newrelic.agent.ThreadService) ConfigService(com.newrelic.agent.config.ConfigService) TransactionService(com.newrelic.agent.TransactionService) MockServiceManager(com.newrelic.agent.MockServiceManager) ProfilerService(com.newrelic.agent.profile.ProfilerService)

Aggregations

ProfilerService (com.newrelic.agent.profile.ProfilerService)8 ThreadService (com.newrelic.agent.ThreadService)5 TransactionService (com.newrelic.agent.TransactionService)5 ConfigService (com.newrelic.agent.config.ConfigService)5 EnvironmentServiceImpl (com.newrelic.agent.environment.EnvironmentServiceImpl)5 TransactionTraceService (com.newrelic.agent.trace.TransactionTraceService)5 AttributesService (com.newrelic.agent.attributes.AttributesService)4 DatabaseService (com.newrelic.agent.database.DatabaseService)4 EnvironmentService (com.newrelic.agent.environment.EnvironmentService)4 RPMConnectionService (com.newrelic.agent.rpm.RPMConnectionService)4 RPMConnectionServiceImpl (com.newrelic.agent.rpm.RPMConnectionServiceImpl)4 HarvestService (com.newrelic.agent.HarvestService)3 HarvestServiceImpl (com.newrelic.agent.HarvestServiceImpl)3 MockServiceManager (com.newrelic.agent.MockServiceManager)3 CircuitBreakerService (com.newrelic.agent.circuitbreaker.CircuitBreakerService)3 ExtensionService (com.newrelic.agent.extension.ExtensionService)3 JmxService (com.newrelic.agent.jmx.JmxService)3 SourceLanguageService (com.newrelic.agent.language.SourceLanguageService)3 TransactionEventsService (com.newrelic.agent.service.analytics.TransactionEventsService)3 AsyncTransactionService (com.newrelic.agent.service.async.AsyncTransactionService)3