예제 #1
0
        public void SetUp()
        {
            var configuration = Mock.Create <IConfiguration>();

            Mock.Arrange(() => configuration.CollectorSendDataOnExit).Returns(true);
            Mock.Arrange(() => configuration.CollectorSendDataOnExitThreshold).Returns(0);
            _configurationAutoResponder = new ConfigurationAutoResponder(configuration);

            _dataTransportService   = Mock.Create <IDataTransportService>();
            _metricBuilder          = WireModels.Utilities.GetSimpleMetricBuilder();
            _agentHealthReporter    = Mock.Create <IAgentHealthReporter>();
            _outOfBandMetricSources = new IOutOfBandMetricSource[] { (IOutOfBandMetricSource)_agentHealthReporter };
            _dnsStatic         = Mock.Create <IDnsStatic>();
            _processStatic     = Mock.Create <IProcessStatic>();
            _metricNameService = Mock.Create <IMetricNameService>();
            Mock.Arrange(() => _metricNameService.RenameMetric(Arg.IsAny <string>())).Returns <string>(name => name);

            var scheduler = Mock.Create <IScheduler>();

            Mock.Arrange(() => scheduler.ExecuteEvery(Arg.IsAny <Action>(), Arg.IsAny <TimeSpan>(), Arg.IsAny <TimeSpan?>()))
            .DoInstead <Action, TimeSpan, TimeSpan?>((action, harvestCycle, __) => { _harvestAction = action; _harvestCycle = harvestCycle; });
            _metricAggregator = new MetricAggregator(_dataTransportService, _metricBuilder, _metricNameService, _outOfBandMetricSources, _processStatic, scheduler);

            EventBus <AgentConnectedEvent> .Publish(new AgentConnectedEvent());
        }
 public SpanEventAggregator(IDataTransportService dataTransportService, IScheduler scheduler, IProcessStatic processStatic, IAgentHealthReporter agentHealthReporter)
     : base(dataTransportService, scheduler, processStatic)
 {
     _agentHealthReporter = agentHealthReporter;
     //we don't care about the returned CPQ because it was initialized with zero size.
     GetAndResetCollection();
 }
예제 #3
0
        public CommandService(IDataTransportService dataTransportService, IScheduler scheduler)
        {
            _dataTransportService = dataTransportService;
            _scheduler            = scheduler;

            _scheduler.ExecuteEvery(GetAndExecuteAgentCommands, TimeSpan.FromMinutes(1));
        }
예제 #4
0
        protected AbstractAggregator(IDataTransportService dataTransportService, IScheduler scheduler, IProcessStatic processStatic)
        {
            DataTransportService = dataTransportService;
            _scheduler           = scheduler;
            _processStatic       = processStatic;

            _subscriptions.Add <AgentConnectedEvent>(OnAgentConnected);
            _subscriptions.Add <PreCleanShutdownEvent>(OnPreCleanShutdown);
        }
예제 #5
0
        public ThreadProfilingService(IDataTransportService dataTransportService, INativeMethods nativeMethods, int maxAggregatedNodes = 20000)
        {
            _dataTransportService = dataTransportService;
            _maxAggregatedNodes   = maxAggregatedNodes;
            _nativeMethods        = nativeMethods;

            _threadProfilingBucket = new ThreadProfilingBucket(this);
            PruningList            = new ArrayList();
        }
        public MetricAggregator(IDataTransportService dataTransportService, IMetricBuilder metricBuilder, IMetricNameService metricNameService, IEnumerable <IOutOfBandMetricSource> outOfBandMetricSources, IProcessStatic processStatic, IScheduler scheduler)
            : base(dataTransportService, scheduler, processStatic)
        {
            _metricBuilder          = metricBuilder;
            _metricNameService      = metricNameService;
            _outOfBandMetricSources = outOfBandMetricSources;

            foreach (var source in outOfBandMetricSources)
            {
                if (source != null)
                {
                    source.RegisterPublishMetricHandler(Collect);
                }
            }

            _metricStatsEngineQueue = CreateMetricStatsEngineQueue();
        }
        public void SetUp()
        {
            var configuration = GetDefaultConfiguration();

            _configurationAutoResponder = new ConfigurationAutoResponder(configuration);

            _dataTransportService = Mock.Create <IDataTransportService>();
            _scheduler            = Mock.Create <IScheduler>();
            Mock.Arrange(() => _scheduler.ExecuteEvery(Arg.IsAny <Action>(), Arg.IsAny <TimeSpan>(), Arg.IsAny <TimeSpan?>()))
            .DoInstead <Action, TimeSpan, TimeSpan?>((action, harvestCycle, __) => { _harvestAction = action; _harvestCycle = harvestCycle; });
            _processStatic       = Mock.Create <IProcessStatic>();
            _agentHealthReporter = Mock.Create <IAgentHealthReporter>();

            _sqlTraceAggregator = new SqlTraceAggregator(_dataTransportService, _scheduler, _processStatic, _agentHealthReporter);

            EventBus <AgentConnectedEvent> .Publish(new AgentConnectedEvent());
        }
예제 #8
0
        public void SetUp()
        {
            var configuration = GetDefaultConfiguration();

            Mock.Arrange(() => configuration.CollectorSendDataOnExit).Returns(true);
            Mock.Arrange(() => configuration.CollectorSendDataOnExitThreshold).Returns(0);
            Mock.Arrange(() => configuration.TransactionEventsHarvestCycle).Returns(ConfiguredHarvestCycle);
            _configurationAutoResponder = new ConfigurationAutoResponder(configuration);

            _dataTransportService = Mock.Create <IDataTransportService>();
            _agentHealthReporter  = Mock.Create <IAgentHealthReporter>();
            _processStatic        = Mock.Create <IProcessStatic>();

            _scheduler = Mock.Create <IScheduler>();
            Mock.Arrange(() => _scheduler.ExecuteEvery(Arg.IsAny <Action>(), Arg.IsAny <TimeSpan>(), Arg.IsAny <TimeSpan?>()))
            .DoInstead <Action, TimeSpan, TimeSpan?>((action, harvestCycle, __) => { _harvestAction = action; _harvestCycle = harvestCycle; });
            _transactionEventAggregator = new TransactionEventAggregator(_dataTransportService, _scheduler, _processStatic, _agentHealthReporter);

            EventBus <AgentConnectedEvent> .Publish(new AgentConnectedEvent());
        }
예제 #9
0
            public void SetUp()
            {
                _dataTransportService = Mock.Create <IDataTransportService>();
                _logging     = new TestUtilities.Logging();
                _disposables = new DisposableCollection
                {
                    _logging
                };

                EventBus <ConfigurationUpdatedEvent> .Publish(new ConfigurationUpdatedEvent(CreateMockConfiguration(),
                                                                                            ConfigurationUpdateSource.Unknown));

                _timestamp          = new DateTime(2018, 1, 1, 1, 0, 0);
                _path               = "WebTransaction/ASP/post.aspx";
                _message            = "The Error Message";
                _exceptionClassName = "System.MyErrorClassName";
                _stackTrace         = CreateStackTrace();
                _guid               = "123";

                _attribDefSvc = new AttributeDefinitionService((f) => new AttributeDefinitions(f));
            }
예제 #10
0
        public void SetUp()
        {
            var configuration = Mock.Create <IConfiguration>();

            Mock.Arrange(() => configuration.CollectorSendDataOnExit).Returns(true);
            Mock.Arrange(() => configuration.CollectorSendDataOnExitThreshold).Returns(0);
            Mock.Arrange(() => configuration.TransactionTracerEnabled).Returns(true);
            _configurationAutoResponder = new ConfigurationAutoResponder(configuration);

            _dataTransportService = Mock.Create <IDataTransportService>();
            _dnsStatic            = Mock.Create <IDnsStatic>();
            _processStatic        = Mock.Create <IProcessStatic>();

            _transactionCollector1 = Mock.Create <ITransactionCollector>();
            _transactionCollector2 = Mock.Create <ITransactionCollector>();
            _transactionCollectors = new[] { _transactionCollector1, _transactionCollector2 };

            _scheduler = Mock.Create <IScheduler>();
            Mock.Arrange(() => _scheduler.ExecuteEvery(Arg.IsAny <Action>(), Arg.IsAny <TimeSpan>(), Arg.IsAny <TimeSpan?>()))
            .DoInstead <Action, TimeSpan, TimeSpan?>((action, harvestCycle, __) => { _harvestAction = action; _harvestCycle = harvestCycle; });
            _transactionTraceAggregator = new TransactionTraceAggregator(_dataTransportService, _scheduler, _processStatic, _transactionCollectors);

            EventBus <AgentConnectedEvent> .Publish(new AgentConnectedEvent());
        }
 public void SetUp()
 {
     _dataTransportService = Mock.Create <IDataTransportService>();
 }
예제 #12
0
 public SqlTraceAggregator(IDataTransportService dataTransportService, IScheduler scheduler, IProcessStatic processStatic, IAgentHealthReporter agentHealthReporter)
     : base(dataTransportService, scheduler, processStatic)
 {
     _agentHealthReporter = agentHealthReporter;
 }
예제 #13
0
 public TransactionTraceAggregator(IDataTransportService dataTransportService, IScheduler scheduler, IProcessStatic processStatic, IEnumerable <ITransactionCollector> transactionCollectors)
     : base(dataTransportService, scheduler, processStatic)
 {
     _transactionCollectors = transactionCollectors;
 }
예제 #14
0
 public CustomEventAggregator(IDataTransportService dataTransportService, IScheduler scheduler, IProcessStatic processStatic, IAgentHealthReporter agentHealthReporter)
     : base(dataTransportService, scheduler, processStatic)
 {
     _agentHealthReporter = agentHealthReporter;
     GetAndResetCollection(_configuration.CustomEventsMaximumSamplesStored);
 }
 public ErrorTraceAggregator(IDataTransportService dataTransportService, IScheduler scheduler, IProcessStatic processStatic, IAgentHealthReporter agentHealthReporter)
     : base(dataTransportService, scheduler, processStatic)
 {
     _agentHealthReporter = agentHealthReporter;
     GetAndResetCollection();
 }
 public ErrorEventAggregator(IDataTransportService dataTransportService, IScheduler scheduler, IProcessStatic processStatic, IAgentHealthReporter agentHealthReporter)
     : base(dataTransportService, scheduler, processStatic)
 {
     _agentHealthReporter = agentHealthReporter;
     ResetCollections(_configuration.ErrorCollectorMaxEventSamplesStored);
 }