[CalendarServer-changes] [6710] CalendarServer/trunk/contrib/tools/protocolanalysis.py

source_changes at macosforge.org source_changes at macosforge.org
Mon Jan 3 09:13:31 PST 2011


Revision: 6710
          http://trac.macosforge.org/projects/calendarserver/changeset/6710
Author:   exarkun at twistedmatrix.com
Date:     2011-01-03 09:13:26 -0800 (Mon, 03 Jan 2011)
Log Message:
-----------
Use safePercent instead of dividing directly, in case the total is zero.

Modified Paths:
--------------
    CalendarServer/trunk/contrib/tools/protocolanalysis.py

Modified: CalendarServer/trunk/contrib/tools/protocolanalysis.py
===================================================================
--- CalendarServer/trunk/contrib/tools/protocolanalysis.py	2010-12-23 02:45:47 UTC (rev 6709)
+++ CalendarServer/trunk/contrib/tools/protocolanalysis.py	2011-01-03 17:13:26 UTC (rev 6710)
@@ -1229,7 +1229,7 @@
         total = sum(summary.values())
         for k, v in sorted(summary.iteritems()):
             # Chop off the "(a):" part.
-            table.addRow((k[4:], v, 100.0 * float(v) / total))
+            table.addRow((k[4:], v, safePercent(float(v), total)))
         table.printTabDelimitedData() if doTabs else table.printTable()
         print ""
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110103/7ae707af/attachment.html>


More information about the calendarserver-changes mailing list