[CalendarServer-changes] [11523] CalendarServer/branches/users/cdaboo/CalendarServer-5.0-podfix/ contrib/tools/readStats.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Jul 17 11:36:27 PDT 2013


Revision: 11523
          http://trac.calendarserver.org//changeset/11523
Author:   cdaboo at apple.com
Date:     2013-07-17 11:36:27 -0700 (Wed, 17 Jul 2013)
Log Message:
-----------
Bug fix from trunk.

Modified Paths:
--------------
    CalendarServer/branches/users/cdaboo/CalendarServer-5.0-podfix/contrib/tools/readStats.py

Modified: CalendarServer/branches/users/cdaboo/CalendarServer-5.0-podfix/contrib/tools/readStats.py
===================================================================
--- CalendarServer/branches/users/cdaboo/CalendarServer-5.0-podfix/contrib/tools/readStats.py	2013-07-17 17:34:30 UTC (rev 11522)
+++ CalendarServer/branches/users/cdaboo/CalendarServer-5.0-podfix/contrib/tools/readStats.py	2013-07-17 18:36:27 UTC (rev 11523)
@@ -322,16 +322,17 @@
 def printMultiHistogramSummary(stats, index):
 
     # Totals first
-    keys = ("requests", "<10ms", "10ms<->100ms", "100ms<->1s", "1s<->10s", "10s<->30s", "30s<->60s", ">60s", "Over 1s", "Over 10s",)
+    keys = ("<10ms", "10ms<->100ms", "100ms<->1s", "1s<->10s", "10s<->30s", "30s<->60s", ">60s", "Over 1s", "Over 10s",)
     totals = {
         "T"        : dict([(k, 0) for k in keys]),
         "T-RESP-WR": dict([(k, 0) for k in keys]),
+        "requests" : 0,
     }
 
     for stat in stats:
         for i in ("T", "T-RESP-WR",):
-            totals[i][keys[0]] += stat[index][keys[0]]
-            for k in keys[1:]:
+            totals["requests"] += stat[index]["requests"]
+            for k in keys:
                 totals[i][k] += stat[index][i][k]
 
     printHistogramSummary(totals, index)
@@ -389,8 +390,9 @@
     for stat in stats:
         for method in stat[index]["method"]:
             methods[method] += stat[index]["method"][method]
-        for method_time in stat[index]["method-t"]:
-            method_times[method_time] += stat[index]["method-t"][method_time]
+        if "method-t" in stat[index]:
+            for method_time in stat[index]["method-t"]:
+                method_times[method_time] += stat[index]["method-t"][method_time]
 
     printMethodCounts({"method": methods, "method-t": method_times})
 
@@ -470,7 +472,7 @@
         for ua in stat[index]["user-agent"]:
             uas[ua] += stat[index]["user-agent"][ua]
 
-    printUserCounts({"user-agent": uas})
+    printAgentCounts({"user-agent": uas})
 
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130717/82af4a1b/attachment.html>


More information about the calendarserver-changes mailing list