private void EnsureBeginUniqueCall(RequestBegin args) { if (_currentRequests.ContainsKey(args.Thread) && _currentRequests[args.Thread].Id == args.Id) { throw new InvalidOperationException(string.Format("Request with id = {0} already begun.", args.Id)); } }
private void OnRequestBegin(RequestBegin args) { EnsureBeginUniqueCall(args); _currentRequests[args.Thread] = args; _currentCallstacks[args.Thread] = new RequestCallStack(); Logger.Trace("BEGIN Request {1}{0}", args.Url, args.Thread); }
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 OnRequestBegin(RequestEventArgs e) { RequestBegin?.Invoke(this, e); }