Search in sources :

Example 6 with ThreadService

use of com.newrelic.agent.ThreadService in project newrelic-java-agent by newrelic.

the class ProfileTest method beforeClass.

@BeforeClass
public static void beforeClass() throws Exception {
    serviceManager = new MockServiceManager();
    ServiceFactory.setServiceManager(serviceManager);
    serviceManager.start();
    ThreadService threadService = new ThreadService();
    serviceManager.setThreadService(threadService);
    Map<String, Object> map = new HashMap<>();
    AgentConfig agentConfig = AgentConfigImpl.createAgentConfig(map);
    ConfigService configService = ConfigServiceFactory.createConfigService(agentConfig, map);
    serviceManager.setConfigService(configService);
    TransactionService transactionService = new TransactionService();
    serviceManager.setTransactionService(transactionService);
    threadNameNormalizer = new ThreadNameNormalizer(agentConfig, threadService);
}
Also used : ThreadService(com.newrelic.agent.ThreadService) AgentConfig(com.newrelic.agent.config.AgentConfig) ConfigService(com.newrelic.agent.config.ConfigService) TransactionService(com.newrelic.agent.TransactionService) HashMap(java.util.HashMap) MockServiceManager(com.newrelic.agent.MockServiceManager) ThreadNameNormalizer(com.newrelic.agent.threads.ThreadNameNormalizer) BeforeClass(org.junit.BeforeClass)

Example 7 with ThreadService

use of com.newrelic.agent.ThreadService in project newrelic-java-agent by newrelic.

the class ProfileSamplerTest method beforeClass.

@BeforeClass
public static void beforeClass() throws Exception {
    MockServiceManager serviceManager = new MockServiceManager();
    ServiceFactory.setServiceManager(serviceManager);
    serviceManager.start();
    ThreadService threadService = new ThreadService();
    serviceManager.setThreadService(threadService);
    Map<String, Object> map = new HashMap<>();
    AgentConfig agentConfig = AgentConfigImpl.createAgentConfig(map);
    ConfigService configService = ConfigServiceFactory.createConfigService(agentConfig, map);
    serviceManager.setConfigService(configService);
    TransactionService transactionService = new TransactionService();
    serviceManager.setTransactionService(transactionService);
}
Also used : ThreadService(com.newrelic.agent.ThreadService) AgentConfig(com.newrelic.agent.config.AgentConfig) ConfigService(com.newrelic.agent.config.ConfigService) TransactionService(com.newrelic.agent.TransactionService) HashMap(java.util.HashMap) MockServiceManager(com.newrelic.agent.MockServiceManager) BeforeClass(org.junit.BeforeClass)

Example 8 with ThreadService

use of com.newrelic.agent.ThreadService in project newrelic-java-agent by newrelic.

the class ProfileSessionTest 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);
    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)

Example 9 with ThreadService

use of com.newrelic.agent.ThreadService in project newrelic-java-agent by newrelic.

the class ProfileTest method beforeClass.

@BeforeClass
public static void beforeClass() throws Exception {
    serviceManager = new MockServiceManager();
    ServiceFactory.setServiceManager(serviceManager);
    serviceManager.start();
    ThreadService threadService = new ThreadService();
    serviceManager.setThreadService(threadService);
    Map<String, Object> map = new HashMap<>();
    AgentConfig agentConfig = AgentConfigImpl.createAgentConfig(map);
    ConfigService configService = ConfigServiceFactory.createConfigService(agentConfig, map);
    serviceManager.setConfigService(configService);
    TransactionService transactionService = new TransactionService();
    serviceManager.setTransactionService(transactionService);
}
Also used : ThreadService(com.newrelic.agent.ThreadService) AgentConfig(com.newrelic.agent.config.AgentConfig) ConfigService(com.newrelic.agent.config.ConfigService) TransactionService(com.newrelic.agent.TransactionService) HashMap(java.util.HashMap) MockServiceManager(com.newrelic.agent.MockServiceManager) BeforeClass(org.junit.BeforeClass)

Example 10 with ThreadService

use of com.newrelic.agent.ThreadService 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

ThreadService (com.newrelic.agent.ThreadService)37 MockServiceManager (com.newrelic.agent.MockServiceManager)34 ConfigService (com.newrelic.agent.config.ConfigService)32 TransactionService (com.newrelic.agent.TransactionService)30 TransactionTraceService (com.newrelic.agent.trace.TransactionTraceService)24 MockRPMServiceManager (com.newrelic.agent.MockRPMServiceManager)23 HarvestService (com.newrelic.agent.HarvestService)21 MockHarvestService (com.newrelic.agent.MockHarvestService)18 AgentConfig (com.newrelic.agent.config.AgentConfig)18 MockCoreService (com.newrelic.agent.MockCoreService)17 SqlTraceService (com.newrelic.agent.sql.SqlTraceService)16 SqlTraceServiceImpl (com.newrelic.agent.sql.SqlTraceServiceImpl)16 MockRPMService (com.newrelic.agent.MockRPMService)15 AttributesService (com.newrelic.agent.attributes.AttributesService)13 StatsService (com.newrelic.agent.stats.StatsService)13 StatsServiceImpl (com.newrelic.agent.stats.StatsServiceImpl)13 ErrorServiceImpl (com.newrelic.agent.errors.ErrorServiceImpl)12 EnvironmentService (com.newrelic.agent.environment.EnvironmentService)8 HashMap (java.util.HashMap)8 EnvironmentServiceImpl (com.newrelic.agent.environment.EnvironmentServiceImpl)7