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(); }
public CommandService(IDataTransportService dataTransportService, IScheduler scheduler) { _dataTransportService = dataTransportService; _scheduler = scheduler; _scheduler.ExecuteEvery(GetAndExecuteAgentCommands, TimeSpan.FromMinutes(1)); }
protected AbstractAggregator(IDataTransportService dataTransportService, IScheduler scheduler, IProcessStatic processStatic) { DataTransportService = dataTransportService; _scheduler = scheduler; _processStatic = processStatic; _subscriptions.Add <AgentConnectedEvent>(OnAgentConnected); _subscriptions.Add <PreCleanShutdownEvent>(OnPreCleanShutdown); }
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()); }
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()); }
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)); }
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>(); }
public SqlTraceAggregator(IDataTransportService dataTransportService, IScheduler scheduler, IProcessStatic processStatic, IAgentHealthReporter agentHealthReporter) : base(dataTransportService, scheduler, processStatic) { _agentHealthReporter = agentHealthReporter; }
public TransactionTraceAggregator(IDataTransportService dataTransportService, IScheduler scheduler, IProcessStatic processStatic, IEnumerable <ITransactionCollector> transactionCollectors) : base(dataTransportService, scheduler, processStatic) { _transactionCollectors = transactionCollectors; }
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); }