public Agent(ITransactionService transactionService, ITransactionTransformer transactionTransformer, IThreadPoolStatic threadPoolStatic, ITransactionMetricNameMaker transactionMetricNameMaker, IPathHashMaker pathHashMaker, ICatHeaderHandler catHeaderHandler, IDistributedTracePayloadHandler distributedTracePayloadHandler, ISyntheticsHeaderHandler syntheticsHeaderHandler, ITransactionFinalizer transactionFinalizer, IBrowserMonitoringPrereqChecker browserMonitoringPrereqChecker, IBrowserMonitoringScriptMaker browserMonitoringScriptMaker, IConfigurationService configurationService, IAgentHealthReporter agentHealthReporter, IAgentTimerService agentTimerService, IMetricNameService metricNameService, Api.ITraceMetadataFactory traceMetadataFactory, ICATSupportabilityMetricCounters catMetricCounters) { _transactionService = transactionService; _transactionTransformer = transactionTransformer; _threadPoolStatic = threadPoolStatic; _transactionMetricNameMaker = transactionMetricNameMaker; _pathHashMaker = pathHashMaker; _catHeaderHandler = catHeaderHandler; _distributedTracePayloadHandler = distributedTracePayloadHandler; _syntheticsHeaderHandler = syntheticsHeaderHandler; _transactionFinalizer = transactionFinalizer; _browserMonitoringPrereqChecker = browserMonitoringPrereqChecker; _browserMonitoringScriptMaker = browserMonitoringScriptMaker; _configurationService = configurationService; _agentHealthReporter = agentHealthReporter; _agentTimerService = agentTimerService; _metricNameService = metricNameService; _traceMetadataFactory = traceMetadataFactory; _catMetricCounters = catMetricCounters; Instance = this; }
public TransactionService(IEnumerable <IContextStorageFactory> factories, ITimerFactory timerFactory, ICallStackManagerFactory callStackManagerFactory, IDatabaseService databaseService, ITracePriorityManager tracePriorityManager, IDatabaseStatementParser databaseStatementParser, IErrorService errorService, IDistributedTracePayloadHandler distributedTracePayloadHandler, IAttributeDefinitionService attribDefSvc) { _sortedPrimaryContexts = GetPrimaryTransactionContexts(factories); _asyncContext = GetAsyncTransactionContext(factories); _timerFactory = timerFactory; _callStackManagerFactory = callStackManagerFactory; _databaseService = databaseService; _tracePriorityManager = tracePriorityManager; _databaseStatementParser = databaseStatementParser; _errorService = errorService; _distributedTracePayloadHandler = distributedTracePayloadHandler; _attribDefSvc = attribDefSvc; }
public void SetUp() { _configuration = Mock.Create <IConfiguration>(); var configurationService = Mock.Create <IConfigurationService>(); Mock.Arrange(() => configurationService.Configuration).Returns(_configuration); _databaseService = new DatabaseService(Mock.Create <ICacheStatsReporter>()); _errorService = new ErrorService(configurationService); _distributedTracePayloadHandler = Mock.Create <IDistributedTracePayloadHandler>(); _attribDefSvc = new AttributeDefinitionService((f) => new AttributeDefinitions(f)); _transaction = new Transaction(_configuration, Mock.Create <ITransactionName>(), Mock.Create <ITimer>(), DateTime.UtcNow, Mock.Create <ICallStackManager>(), _databaseService, Priority, Mock.Create <IDatabaseStatementParser>(), _distributedTracePayloadHandler, _errorService, _attribDefs); _publishedEvent = null; _eventSubscription = new EventSubscription <TransactionFinalizedEvent>(e => _publishedEvent = e); _wrapperToken = new object(); }