public async Task Invoke(IDictionary <string, object> contextDict) { TimerMetrics.StartRequest(); TimerMetrics.StartResponse(); ++_activeRequests; _owinContext = new OwinContext(contextDict); await _next.Invoke(contextDict); --_activeRequests; _errors4xx = _owinContext.Response.StatusCode.ToString()[0] == '4' ? ++_errors4xx : _errors4xx; _errors5xx = _owinContext.Response.StatusCode.ToString()[0] == '5' ? ++_errors5xx : _errors5xx; RequestMetrics(); }
public void RequestHandle() { TimerMetrics.StartResponse(); TimerMetrics.StartRequest(); ApplicationMetricsHandle(EnumRequestResponse.Request); }