Beispiel #1
0
        public async Task Invoke(HttpContext httpContext, UriForwardingTransformer uriTransformer, TrackedRequestAccessor requestLog, ConnectionInfoFactory connectionFactory)
        {
            var connection = await connectionFactory.GetConnection();

            var request = new TrackedRequest(httpContext.Request, uriTransformer, connection);

            _exchangeLog.Add(request);
            requestLog.SetRequest(request);

            await _next(httpContext);

            request.Complete(new TrackedResponse(httpContext.Response));
        }
Beispiel #2
0
 public void AddRequestLog(string action)
 {
     Context.Send(o =>
     {
         var keyvalue = RequestLog.FirstOrDefault(kv => kv.Key == action);
         if (keyvalue != null)
         {
             keyvalue.Value++;
         }
         else
         {
             var keyVal = new KeyValue
             {
                 Key   = action,
                 Value = 1
             };
             RequestLog.Add(keyVal);
         }
     }, null);
 }