Example #1
0
 public void Update(string queryString, IQueryCollection requestQuery, long duration, string action)
 {
     if (RequestLatencies.TryGetValue(action, out var hintQueue) == false)
     {
         var queue = new Concurrent.ConcurrentQueue <RequestLatencyInfo>();
         queue.Enqueue(new RequestLatencyInfo(queryString, requestQuery.ToDictionary(x => x.Key, x => x.Value.FirstOrDefault()), duration, action));
         RequestLatencies.Add(action, queue);
     }
     else
     {
         EnforceLimitOfQueueLength(hintQueue);
         hintQueue.Enqueue(new RequestLatencyInfo(queryString, requestQuery.ToDictionary(x => x.Key, x => x.Value.FirstOrDefault()), duration, action));
     }
 }
 public void Update(long duration, string action, string query)
 {
     if (RequestLatencies.TryGetValue(action, out var hintQueue) == false)
     {
         var queue = new Concurrent.ConcurrentQueue <RequestLatencyInfo>();
         queue.Enqueue(new RequestLatencyInfo(duration, action, query));
         RequestLatencies.Add(action, queue);
     }
     else
     {
         EnforceLimitOfQueueLength(hintQueue);
         hintQueue.Enqueue(new RequestLatencyInfo(duration, action, query));
     }
 }