internal void OnResponseError(EventResponseErrorArgs e) { if (HttpServer.EnableLog(BeetleX.EventArgs.LogType.Warring)) { HttpServer.Log(BeetleX.EventArgs.LogType.Warring, $"Gateway {e.Request.ID} {e.Request.RemoteIPAddress} {e.Request.Method} {e.Request.Url} error {e.Message}"); } if (Pluginer.RequestedEnabled) { EventRequestCompletedArgs se = new EventRequestCompletedArgs( null, e.Request, e.Response, this, e.ErrorCode, null, 1, e.Request.ID, e.Message ); Pluginer.Requested(se); } IncrementRequestCompleted(e.Request, e.ErrorCode, 1, null); this.Pluginer.ResponseError(e); if (e.Result != null) { e.Response.Result(e.Result); } }
internal void OnRequestCompleted(Servers.RequestAgent agent) { this.Statistics.Add(agent.Code); EventRequestCompletedArgs e = new EventRequestCompletedArgs(agent.Request, agent.Response, agent.Code); Requested?.Invoke(this, e); }
internal void OnRequestCompleted(Servers.RequestAgent success) { HttpServer.RequestExecuted(); if (Requested != null) { EventRequestCompletedArgs e = new EventRequestCompletedArgs(success.UrlRoute, success.Request, success.Response, this, success.Code, success.Server, success.Time); Requested(this, e); } }
public EventRequestCompletedArgs GetEventRequestCompletedArgs() { if (eventRequestCompletedArgs.Gateway == null) { eventRequestCompletedArgs = new EventRequestCompletedArgs( this.UrlRoute, this.Request, this.Response, this.Server.Gateway, this.Code, this.Server, this.Time, this.Request.ID, ResponseError != null ? ResponseError.Message : null ); } return(eventRequestCompletedArgs); }
public void Execute(EventRequestCompletedArgs e) { logger.Info($"请求时长:{e.Time} ms"); Console.WriteLine($"请求时长:{e.Time} ms"); }
public void Execute(EventRequestCompletedArgs e) { Console.WriteLine($"{DateTime.Now} {e.RemoteIPAddress} {e.Gateway.InstanceID} {e.RequestID} {e.SourceUrl} {e.Code}"); }
public void Execute(EventRequestCompletedArgs e) { Console.WriteLine($"{e.Url} request to {e.Server.Uri} user time {e.Time}ms"); }
public void Execute(EventRequestCompletedArgs e) { Console.WriteLine("RequestedTest"); }