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/27 19:04:32 UTC

git commit: Backport TS-1110

Updated Branches:
  refs/heads/3.0.x a347b249a -> 304050432


Backport TS-1110


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

Branch: refs/heads/3.0.x
Commit: 3040504320e4bfe60e683a822d24a85d5c0f982b
Parents: a347b24
Author: Brian Geffon <br...@apache.org>
Authored: Mon Feb 27 10:04:24 2012 -0800
Committer: Brian Geffon <br...@apache.org>
Committed: Mon Feb 27 10:04:24 2012 -0800

----------------------------------------------------------------------
 CHANGES           |    3 +++
 STATUS            |    5 -----
 proxy/logstats.cc |   20 +++++++++++++-------
 3 files changed, 16 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/30405043/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index f013999..8b0ba2c 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 3.0.4
+
+  *) [TS-1110] logstats incorrectly bucketizes all status codes greater 
+  than 599 as 5xx
   
   *) [TS-1065] Traffic Cop: segment fault when TRACE_LOG_COP is enabled
    Author: Conan Wang

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/30405043/STATUS
----------------------------------------------------------------------
diff --git a/STATUS b/STATUS
index 9a744f0..7a58fb5 100644
--- a/STATUS
+++ b/STATUS
@@ -41,11 +41,6 @@ A list of all bugs open for the next v3.0.4 release can be found at
 
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
 
-  *) logstats incorrectly bucketizes all status codes greater than 599 as 5xx
-   Trunk patch: https://git-wip-us.apache.org/repos/asf?p=trafficserver.git;a=commit;h=8421675e42f9c09715ce02557afc258be7fed389
-   Jira: https://issues.apache.org/jira/browse/TS-1110
-   +1: briang, igalic, zwoop
-
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/30405043/proxy/logstats.cc
----------------------------------------------------------------------
diff --git a/proxy/logstats.cc b/proxy/logstats.cc
index 9e7824d..d87c295 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) {
@@ -474,13 +477,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) {
@@ -555,6 +560,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);
 }