private Request CreateRequestStats( RequestBegin begin, RequestEnd end) { List<Method> methods = null; if (_currentCallstacks.ContainsKey(end.Thread)) { methods = _currentCallstacks[end.Thread].ToList(); _currentCallstacks.Remove(end.Thread); } return new Request(begin.Id,begin.Url,begin.Time,(end.Time - begin.Time).Ticks,methods); }
private void Context_EndRequest(object sender, EventArgs e) { if (HttpContext.Current.CurrentNotification == RequestNotification.EndRequest) { float elapsedTime = (float)_stopwatch.ElapsedTicks / Stopwatch.Frequency; _stopwatch.Reset(); RequestEnd?.Invoke(this, new TimerModuleEventArgs() { Duration = elapsedTime }); } }
private void OnRequestEnd(RequestEnd args) { if (_currentRequests.ContainsKey(args.Thread)) { if (_currentRequests[args.Thread].Id == args.Id) { Logger.Trace("END Request {1}{0}", _currentRequests[args.Thread].Url, args.Thread); var request = CreateRequestStats(_currentRequests[args.Thread],args); _requestStatsConsumer.Tell(request); _currentRequests.Remove(args.Thread); } else { Logger.Warn("Current Thread with id = {0} is handling different request. Expected: {1}, actual: {2}", args.Thread.ThreadId, args.Id, _currentRequests[args.Thread].Id); } } }
public virtual void OnRequestEnd(WebEventArgs e) { RequestEnd?.Invoke(e.Context, e); }
private void OnRequestEnd(RequestEventArgs e) { RequestEnd?.Invoke(this, e); }