You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by br...@apache.org on 2012/02/15 18:50:44 UTC

git commit: TS-1110: logstats incorrectly bucketizes all status codes greather than 599 as 5xx

Updated Branches:
  refs/heads/master 4eea5f0ed -> 8421675e4


TS-1110: logstats incorrectly bucketizes all status codes greather than 599 as 5xx


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/8421675e
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/8421675e
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/8421675e

Branch: refs/heads/master
Commit: 8421675e42f9c09715ce02557afc258be7fed389
Parents: 4eea5f0
Author: Brian Geffon <br...@apache.org>
Authored: Wed Feb 15 09:50:32 2012 -0800
Committer: Brian Geffon <br...@apache.org>
Committed: Wed Feb 15 09:50:32 2012 -0800

----------------------------------------------------------------------
 proxy/logstats.cc |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8421675e/proxy/logstats.cc
----------------------------------------------------------------------
diff --git a/proxy/logstats.cc b/proxy/logstats.cc
index 7c818f9..99e453a 100644
--- a/proxy/logstats.cc
+++ b/proxy/logstats.cc
@@ -325,6 +325,7 @@ struct UrlStats
   const char *url;
   StatsCounter req;
   ElapsedStats time;
+  int64_t c_000; 
   int64_t c_2xx;
   int64_t c_3xx;
   int64_t c_4xx;
@@ -406,13 +407,15 @@ public:
       ++(l->req.count);
       l->req.bytes += bytes;
 
-      if (http_code >= 500)
+      if ((http_code >= 600) || (http_code < 200))
+        ++(l->c_000);
+      else if (http_code >= 500)
         ++(l->c_5xx);
       else if (http_code >= 400)
         ++(l->c_4xx);
       else if (http_code >= 300)
         ++(l->c_3xx);
-      else if (http_code >= 200)
+      else // http_code >= 200
         ++(l->c_2xx);
 
       switch (result) {
@@ -473,13 +476,15 @@ public:
       l->req.bytes = bytes;
       l->req.count = 1;
 
-      if (http_code >= 500)
+      if ((http_code >= 600) || (http_code < 200))
+        l->c_000 = 1;
+      else if (http_code >= 500)
         l->c_5xx = 1;
       else if (http_code >= 400)
         l->c_4xx = 1;
       else if (http_code >= 300)
         l->c_3xx = 1;
-      else if (http_code >= 200)
+      else // http_code >= 200
         l->c_2xx = 1;
 
       switch (result) {
@@ -554,6 +559,7 @@ private:
       "\", \"hits\" : \"" <<  u->hits << 
       "\", \"misses\" : \"" <<  u->misses << 
       "\", \"errors\" : \"" <<  u->errors <<
+      "\", \"000\" : \"" <<  u->c_000 <<
       "\", \"2xx\" : \"" <<  u->c_2xx <<
       "\", \"3xx\" : \"" <<  u->c_3xx <<
       "\", \"4xx\" : \"" <<  u->c_4xx <<
@@ -1081,7 +1087,9 @@ update_codes(OriginStats * stat, int code, int size)
     break;
   }
 
-  if (code >= 500)
+  if ((code >= 600) || (code < 200))
+    update_counter(stat->codes.c_000, size);
+  else if (code >= 500)
     update_counter(stat->codes.c_5xx, size);
   else if (code >= 400)
     update_counter(stat->codes.c_4xx, size);
@@ -1089,8 +1097,6 @@ update_codes(OriginStats * stat, int code, int size)
     update_counter(stat->codes.c_3xx, size);
   else if (code >= 200)
     update_counter(stat->codes.c_2xx, size);
-  else
-    update_counter(stat->codes.c_000, size);
 }