Exemplo n.º 1
0
        public void SupportabilityMetrics_SpanQueueSize()
        {
            Mock.Arrange(() => _currentConfiguration.InfiniteTracingQueueSizeSpans).Returns(1000);

            int?rptQueueSize = null;

            Mock.Arrange(() => _mockAgentHealthReporter.ReportInfiniteTracingSpanQueueSize(Arg.IsAny <int>()))
            .DoInstead <int>((queueSize) =>
            {
                rptQueueSize = queueSize;
            });


            const int collectionSize = 72;
            var       streamingSvc   = GetMockStreamingService(true, true);

            var aggregator = CreateAggregator(streamingSvc);

            FireAgentConnectedEvent();

            for (var i = 0; i < collectionSize; i++)
            {
                aggregator.Collect(new SpanAttributeValueCollection());
            }

            aggregator.ReportSupportabilityMetrics();

            Assert.AreEqual(rptQueueSize, collectionSize, "Queue Size Supportability Metric");
        }
 public void ReportSupportabilityMetrics()
 {
     _agentHealthReporter.ReportInfiniteTracingSpanQueueSize(_spanEvents.Count);
 }