Exemplo n.º 1
0
        public void SendXyz_GenerateCollectorErrorExceptionSupportabilityMetrics_ForHttpExceptions()
        {
            var exception = new HttpException(HttpStatusCode.InternalServerError, "Internal Server Error");

            Mock.Arrange(() => _connectionManager.SendDataRequest <object>(Arg.IsAny <string>(), Arg.IsAny <object[]>()))
            .Throws(exception);

            _dataTransportService.Send(Arg.IsAny <EventHarvestData>(), Enumerable.Empty <TransactionEventWireModel>());

            Mock.Assert(() => _agentHealthReporter.ReportSupportabilityCollectorErrorException(Arg.Is("analytic_event_data"), Arg.IsAny <TimeSpan>(), Arg.Is(exception.StatusCode)));
        }
Exemplo n.º 2
0
        private void LogErrorResponse(Exception exception, string method, DateTime startTime, HttpStatusCode?httpStatusCode)
        {
            var endTime = DateTime.UtcNow;

            _agentHealthReporter.ReportSupportabilityCollectorErrorException(method, endTime - startTime, httpStatusCode);
            Log.Error(exception);
        }