use of com.newrelic.agent.sql.SqlTraceService 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));
}
use of com.newrelic.agent.sql.SqlTraceService in project newrelic-java-agent by newrelic.
the class SegmentTest method createServiceManager.
private static void createServiceManager(Map<String, Object> map, ExpirationService expirationService) throws Exception {
ConfigService configService = ConfigServiceFactory.createConfigServiceUsingSettings(map);
MockServiceManager serviceManager = new MockServiceManager(configService);
ServiceFactory.setServiceManager(serviceManager);
ThreadService threadService = new ThreadService();
serviceManager.setThreadService(threadService);
serviceManager.setConfigService(configService);
StatsService statsService = new StatsServiceImpl();
serviceManager.setStatsService(statsService);
MockCoreService agent = new MockCoreService();
serviceManager.setCoreService(agent);
HarvestService harvestService = new MockHarvestService();
serviceManager.setHarvestService(harvestService);
AsyncTransactionService asyncTxService = new AsyncTransactionService();
serviceManager.setAsyncTransactionService(asyncTxService);
TransactionService transactionService = new TransactionService(2, 1, 3, TimeUnit.SECONDS);
serviceManager.setTransactionService(transactionService);
EnvironmentService envService = new EnvironmentServiceImpl();
serviceManager.setEnvironmentService(envService);
TransactionTraceService transactionTraceService = new TransactionTraceService();
serviceManager.setTransactionTraceService(transactionTraceService);
SqlTraceService sqlTraceService = new SqlTraceServiceImpl();
serviceManager.setSqlTraceService(sqlTraceService);
serviceManager.setAttributesService(new AttributesService());
DistributedTraceServiceImpl distributedTraceService = new DistributedTraceServiceImpl();
Map<String, Object> configMap = ImmutableMap.<String, Object>builder().put("cross_application_tracer", ImmutableMap.builder().put("account_id", "12abc345").put("trusted_account_key", "12abc345").build()).build();
distributedTraceService.connected(null, AgentConfigFactory.createAgentConfig(configMap, null, null));
serviceManager.setDistributedTraceService(distributedTraceService);
TransactionDataToDistributedTraceIntrinsics transactionDataToDistributedTraceIntrinsics = new TransactionDataToDistributedTraceIntrinsics(distributedTraceService);
serviceManager.setTransactionEventsService(new TransactionEventsService(transactionDataToDistributedTraceIntrinsics));
MockRPMServiceManager rpmServiceManager = new MockRPMServiceManager();
serviceManager.setRPMServiceManager(rpmServiceManager);
serviceManager.setExpirationService(expirationService);
SpanEventsService spanEventsService = SpanEventsServiceFactory.builder().configService(configService).reservoirManager(new MockSpanEventReservoirManager(configService)).transactionService(serviceManager.getTransactionService()).rpmServiceManager(serviceManager.getRPMServiceManager()).spanEventCreationDecider(new SpanEventCreationDecider(configService)).environmentService(envService).transactionDataToDistributedTraceIntrinsics(transactionDataToDistributedTraceIntrinsics).build();
serviceManager.setSpansEventService(spanEventsService);
serviceManager.start();
}
use of com.newrelic.agent.sql.SqlTraceService in project newrelic-java-agent by newrelic.
the class TransactionTest method createServiceManager.
private static void createServiceManager(Map<String, Object> map) throws Exception {
serviceManager = new MockServiceManager();
ServiceFactory.setServiceManager(serviceManager);
serviceManager.start();
serviceManager.setThreadService(threadService);
Map<String, Object> serverData = new HashMap<>();
serverData.put(CrossProcessConfigImpl.CROSS_PROCESS_ID, "12345#56789");
serverData.put(CrossProcessConfigImpl.APPLICATION_ID, "56789");
serverData.put(CrossProcessConfigImpl.TRUSTED_ACCOUNT_IDS, "12345,9123");
AgentConfig agentConfig = AgentHelper.createAgentConfig(true, map, serverData);
ConfigService configService = ConfigServiceFactory.createConfigService(agentConfig, map);
serviceManager.setConfigService(configService);
StatsService statsService = new StatsServiceImpl();
serviceManager.setStatsService(statsService);
MockCoreService agent = new MockCoreService();
serviceManager.setCoreService(agent);
HarvestService harvestService = new MockHarvestService();
serviceManager.setHarvestService(harvestService);
TransactionService transactionService = new TransactionService();
serviceManager.setTransactionService(transactionService);
EnvironmentService envService = new EnvironmentServiceImpl();
serviceManager.setEnvironmentService(envService);
TransactionTraceService transactionTraceService = new TransactionTraceService();
serviceManager.setTransactionTraceService(transactionTraceService);
SqlTraceService sqlTraceService = new SqlTraceServiceImpl();
serviceManager.setSqlTraceService(sqlTraceService);
serviceManager.setAttributesService(new AttributesService());
serviceManager.setAsyncTransactionService(new AsyncTransactionService());
MockRPMServiceManager rpmServiceManager = new MockRPMServiceManager();
serviceManager.setRPMServiceManager(rpmServiceManager);
DistributedTraceServiceImpl distributedTraceService = new DistributedTraceServiceImpl();
serviceManager.setDistributedTraceService(distributedTraceService);
distributedTraceService.start();
TransactionDataToDistributedTraceIntrinsics transactionDataToDistributedTraceIntrinsics = new TransactionDataToDistributedTraceIntrinsics(distributedTraceService);
serviceManager.setTransactionEventsService(new TransactionEventsService(transactionDataToDistributedTraceIntrinsics));
serviceManager.setExpirationService(new SegmentTest.InlineExpirationService());
AgentBridge.instrumentation = new InstrumentationImpl(Agent.LOG);
AgentBridge.agent = new AgentImpl(Agent.LOG);
List<ConnectionListener> connectionListeners = rpmServiceManager.getConnectionListeners();
for (ConnectionListener connectionListener : connectionListeners) {
connectionListener.connected(rpmServiceManager.getRPMService(), agentConfig);
}
}
use of com.newrelic.agent.sql.SqlTraceService in project newrelic-java-agent by newrelic.
the class TransactionAsyncUtility method createServiceManager.
public static void createServiceManager(Map<String, Object> map) throws Exception {
ConfigService configService = ConfigServiceFactory.createConfigServiceUsingSettings(map);
MockServiceManager serviceManager = new MockServiceManager(configService);
ServiceFactory.setServiceManager(serviceManager);
ThreadService threadService = new ThreadService();
serviceManager.setThreadService(threadService);
MockCoreService agent = new MockCoreService();
serviceManager.setCoreService(agent);
HarvestService harvestService = new MockHarvestService();
serviceManager.setHarvestService(harvestService);
EnvironmentService envService = new EnvironmentServiceImpl();
serviceManager.setEnvironmentService(envService);
AsyncTransactionService asyncTxService = new AsyncTransactionService();
serviceManager.setAsyncTransactionService(asyncTxService);
serviceManager.setStatsService(new StatsServiceImpl());
TransactionService transactionService = new TransactionService();
serviceManager.setTransactionService(transactionService);
TransactionTraceService transactionTraceService = new TransactionTraceService();
serviceManager.setTransactionTraceService(transactionTraceService);
SqlTraceService sqlTraceService = new SqlTraceServiceImpl();
serviceManager.setSqlTraceService(sqlTraceService);
serviceManager.setAttributesService(new AttributesService());
MockRPMServiceManager rpmServiceManager = new MockRPMServiceManager();
serviceManager.setRPMServiceManager(rpmServiceManager);
DistributedTraceServiceImpl distributedTraceService = new DistributedTraceServiceImpl();
serviceManager.setDistributedTraceService(distributedTraceService);
TransactionDataToDistributedTraceIntrinsics transactionDataToDistributedTraceIntrinsics = new TransactionDataToDistributedTraceIntrinsics(distributedTraceService);
serviceManager.setTransactionEventsService(new TransactionEventsService(transactionDataToDistributedTraceIntrinsics));
serviceManager.setExpirationService(new ExpirationService());
serviceManager.start();
}
use of com.newrelic.agent.sql.SqlTraceService in project newrelic-java-agent by newrelic.
the class RumStreamParserTest method createServiceManager.
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();
}
Aggregations