Example #1
0
        public void error_trace_sent_is_reported_to_agent_health()
        {
            // Arrange
            _errorTraceAggregator.Collect(Mock.Create <ErrorTraceWireModel>());

            // Act
            _harvestAction();

            // Assert
            Mock.Assert(() => _agentHealthReporter.ReportErrorTracesSent(1));
        }
        private void HandleResponse(DataTransportResponseStatus responseStatus, ICollection <ErrorTraceWireModel> errorTraceWireModels)
        {
            switch (responseStatus)
            {
            case DataTransportResponseStatus.RequestSuccessful:
                _agentHealthReporter.ReportErrorTracesSent(errorTraceWireModels.Count);
                break;

            case DataTransportResponseStatus.Retain:
                Retain(errorTraceWireModels);
                break;

            case DataTransportResponseStatus.ReduceSizeIfPossibleOtherwiseDiscard:
            case DataTransportResponseStatus.Discard:
            default:
                break;
            }
        }