use of com.newrelic.agent.config.ConfigService in project newrelic-java-agent by newrelic.
the class StatsEngineTest method createServiceManager.
/**
* Creates the service manager.
*
* @param map The configuration for the mananger.
* @throws Exception Thrown if a problem creating the service manager.
*/
private static void createServiceManager(Map<String, Object> map) throws Exception {
MockServiceManager serviceManager = new MockServiceManager();
ServiceFactory.setServiceManager(serviceManager);
serviceManager.start();
ThreadService threadService = new ThreadService();
serviceManager.setThreadService(threadService);
ConfigService configService = ConfigServiceFactory.createConfigService(AgentConfigImpl.createAgentConfig(map), map);
serviceManager.setConfigService(configService);
MockCoreService agent = new MockCoreService();
serviceManager.setCoreService(agent);
HarvestService harvestService = new MockHarvestService();
serviceManager.setHarvestService(harvestService);
TransactionService transactionService = new TransactionService();
serviceManager.setTransactionService(transactionService);
TransactionTraceService transactionTraceService = new TransactionTraceService();
serviceManager.setTransactionTraceService(transactionTraceService);
SqlTraceService sqlTraceService = new SqlTraceServiceImpl();
serviceManager.setSqlTraceService(sqlTraceService);
MockRPMServiceManager rpmServiceManager = new MockRPMServiceManager();
serviceManager.setRPMServiceManager(rpmServiceManager);
MockRPMService rpmService = new MockRPMService();
rpmService.setApplicationName(APP_NAME);
rpmService.setErrorService(new ErrorServiceImpl(APP_NAME));
rpmServiceManager.setRPMService(rpmService);
configService.start();
serviceManager.setNormalizationService(new NormalizationServiceImpl());
StatsService statsService = new StatsServiceImpl();
serviceManager.setStatsService(statsService);
statsService.start();
}
use of com.newrelic.agent.config.ConfigService in project newrelic-java-agent by newrelic.
the class SyntheticsTransactionSamplerTest method createServiceManager.
private static void createServiceManager(Map<String, Object> configMap) throws Exception {
MockServiceManager serviceManager = new MockServiceManager();
ServiceFactory.setServiceManager(serviceManager);
ConfigService configService = ConfigServiceFactory.createConfigService(AgentConfigImpl.createAgentConfig(configMap), configMap);
serviceManager.setConfigService(configService);
DatabaseService dbService = new DatabaseService();
serviceManager.setDatabaseService(dbService);
HarvestService harvestService = new MockHarvestService();
serviceManager.setHarvestService(harvestService);
TransactionService transactionService = new TransactionService();
serviceManager.setTransactionService(transactionService);
MockRPMServiceManager rpmServiceManager = new MockRPMServiceManager();
serviceManager.setRPMServiceManager(rpmServiceManager);
MockRPMService rpmService = new MockRPMService();
rpmService.setApplicationName(APP_NAME);
rpmService.setIsConnected(true);
rpmServiceManager.setRPMService(rpmService);
CommandParser commandParser = new CommandParser();
serviceManager.setCommandParser(commandParser);
AttributesService attService = new AttributesService();
serviceManager.setAttributesService(attService);
TransactionTraceService ttService = new TransactionTraceService();
serviceManager.setTransactionTraceService(ttService);
ttService.start();
}
use of com.newrelic.agent.config.ConfigService in project newrelic-java-agent by newrelic.
the class TransactionSegmentTest method setupServiceManager.
private MockServiceManager setupServiceManager(Map<String, Object> transactionSegmentsConfig) {
final Map<String, Object> config = new HashMap<>();
config.put(AgentConfigImpl.APP_NAME, "name");
config.put(AgentConfigImpl.TRANSACTION_SEGMENTS, transactionSegmentsConfig);
MockServiceManager manager = new MockServiceManager();
ConfigService configService = ConfigServiceFactory.createConfigService(AgentConfigImpl.createAgentConfig(config), config);
manager.setConfigService(configService);
manager.setAttributesService(new AttributesService());
ServiceFactory.setServiceManager(manager);
return manager;
}
use of com.newrelic.agent.config.ConfigService in project newrelic-java-agent by newrelic.
the class DistributedTracingApiTest method setupConfig.
private void setupConfig(boolean excludeNRHeader) {
Map<String, Object> dtConfig = ImmutableMap.<String, Object>of("enabled", true, "exclude_newrelic_header", excludeNRHeader);
Map<String, Object> spanConfig = ImmutableMap.of("collect_span_events", (Object) true);
Map<String, Object> config = ImmutableMap.of(APP_NAME, "test", "distributed_tracing", dtConfig, "span_events", spanConfig);
agentConfig = AgentConfigImpl.createAgentConfig(config);
ConfigService configService = ConfigServiceFactory.createConfigService(agentConfig, Collections.<String, Object>emptyMap());
serviceManager.setConfigService(configService);
}
use of com.newrelic.agent.config.ConfigService in project newrelic-java-agent by newrelic.
the class SpanProxyTest method before.
@Before
public void before() throws Exception {
Map<String, Object> config = new HashMap<>();
config.put(AgentConfigImpl.APP_NAME, "Test");
Map<String, Object> dtConfig = new HashMap<>();
dtConfig.put("enabled", true);
config.put("distributed_tracing", dtConfig);
Map<String, Object> spanConfig = new HashMap<>();
spanConfig.put("collect_span_events", true);
config.put("span_events", spanConfig);
ConfigService configService = ConfigServiceFactory.createConfigService(AgentConfigImpl.createAgentConfig(config), Collections.<String, Object>emptyMap());
MockServiceManager serviceManager = new MockServiceManager(configService);
ServiceFactory.setServiceManager(serviceManager);
serviceManager.setConfigService(configService);
ServiceFactory.getServiceManager().start();
serviceManager.setDistributedTraceService(new MockDistributedTraceService());
}
Aggregations