Exemplo n.º 1
0
        public void EventsSentReportedOnHarvest()
        {
            const int eventCount = 1;

            // Arrange
            CollectSpanEvents(eventCount);

            // Act
            _harvestAction();

            // Assert
            Mock.Assert(() => _agentHealthReporter.ReportSpanEventCollected(eventCount));
            Mock.Assert(() => _agentHealthReporter.ReportSpanEventsSent(eventCount));
        }
        private void HandleResponse(DataTransportResponseStatus responseStatus, ICollection <ISpanEventWireModel> spanEvents)
        {
            switch (responseStatus)
            {
            case DataTransportResponseStatus.RequestSuccessful:
                _agentHealthReporter.ReportSpanEventsSent(spanEvents.Count);
                break;

            case DataTransportResponseStatus.Retain:
                RetainEvents(spanEvents);
                break;

            case DataTransportResponseStatus.ReduceSizeIfPossibleOtherwiseDiscard:
                ReduceReservoirSize((int)(spanEvents.Count * ReservoirReductionSizeMultiplier));
                RetainEvents(spanEvents);
                break;

            case DataTransportResponseStatus.Discard:
            default:
                break;
            }
        }