示例#1
0
        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 void SetUp()
        {
            _compositeTestAgent = new CompositeTestAgent();
            _compositeTestAgent.LocalConfiguration.distributedTracing.enabled     = false;
            _compositeTestAgent.LocalConfiguration.crossApplicationTracingEnabled = true;
            _compositeTestAgent.ServerConfiguration.AccountId            = _accountId.ToString();
            _compositeTestAgent.ServerConfiguration.TrustedAccountKey    = _trustKey;
            _compositeTestAgent.ServerConfiguration.PrimaryApplicationId = _appId.ToString();
            _catMetricCounters = _compositeTestAgent.Container.Resolve <ICATSupportabilityMetricCounters>();

            var crossProcessID = $"{_accountId}#{_appId}";

            _crossProcessIDEncoded = Strings.Base64Encode(crossProcessID, _agent.Configuration.EncodingKey);

            var reqData = new CrossApplicationRequestData("referrerTransactionGuid", false, "referrerTripId", "referrerPathHash");

            _reqDataEncoded = HeaderEncoder.SerializeAndEncode(reqData, _agent.Configuration.EncodingKey);

            _compositeTestAgent.ServerConfiguration.TrustedIds = new long[] { _accountId };

            _compositeTestAgent.PushConfiguration();
        }
 public CatHeaderHandler(IConfigurationService configurationService, ICATSupportabilityMetricCounters supportabilityMetricCounters)
 {
     _configurationService  = configurationService;
     _supportabilityMetrics = supportabilityMetricCounters;
 }