Example #1
0
 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);
     }
 }
Example #2
0
        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);
        }
Example #3
0
 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);
     }
 }
Example #4
0
 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);
 }
Example #5
0
 public void Execute(EventRequestCompletedArgs e)
 {
     logger.Info($"请求时长:{e.Time} ms");
     Console.WriteLine($"请求时长:{e.Time} ms");
 }
Example #6
0
 public void Execute(EventRequestCompletedArgs e)
 {
     Console.WriteLine($"{DateTime.Now} {e.RemoteIPAddress} {e.Gateway.InstanceID} {e.RequestID} {e.SourceUrl} {e.Code}");
 }
Example #7
0
 public void Execute(EventRequestCompletedArgs e)
 {
     Console.WriteLine($"{e.Url} request to {e.Server.Uri} user time {e.Time}ms");
 }
Example #8
0
 public void Execute(EventRequestCompletedArgs e)
 {
     Console.WriteLine("RequestedTest");
 }