Beispiel #1
0
        public static void Success(LogEntry entry, HttpStatusCode statusCode, long elapsedMilliseconds)
        {
            var item = new Stat()
                {
                    Delay = elapsedMilliseconds,
                    IsException = false,
                    Status = statusCode,
                    Url = entry.Uri,
                    Time = DateTime.Now,
                    LogEntryHash = entry.Hash,
                    BatchId = entry.BatchId,
                    RunnerId = Configuration.RunnerId
                };
            Stats.Add(item);
            StatsConsolidator.Add(item);

            //switch (resp.StatusCode)
            //{
            //    case HttpStatusCode.NotFound:
            //    case HttpStatusCode.Forbidden:
            //    case HttpStatusCode.Unauthorized:
            //    case HttpStatusCode.BadRequest:
            //    case HttpStatusCode.ProxyAuthenticationRequired:
            //    case HttpStatusCode.NoContent:
            //    case HttpStatusCode.MethodNotAllowed:
            //    case HttpStatusCode.InternalServerError:

            //        break;
            //    case HttpStatusCode.Redirect:
            //    case HttpStatusCode.Moved:

            //        break;
            //    case HttpStatusCode.OK:

            //        break;
            //    default:

            //}
        }
Beispiel #2
0
 public static void Exception(LogEntry entry)
 {
     var item = new Stat() { IsException = true, Url = entry.Uri, Time = DateTime.Now, Status = HttpStatusCode.Unused, LogEntryHash = entry.Hash, BatchId = entry.BatchId, RunnerId = Configuration.RunnerId};
     Stats.Add(item);
     StatsConsolidator.Add(item);
 }