[CalendarServer-changes] [6125] CalendarServer/trunk/contrib/performance/stats.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Aug 18 17:25:21 PDT 2010


Revision: 6125
          http://trac.macosforge.org/projects/calendarserver/changeset/6125
Author:   exarkun at twistedmatrix.com
Date:     2010-08-18 17:25:21 -0700 (Wed, 18 Aug 2010)
Log Message:
-----------
report ms for sql query times instead of seconds

Modified Paths:
--------------
    CalendarServer/trunk/contrib/performance/stats.py

Modified: CalendarServer/trunk/contrib/performance/stats.py
===================================================================
--- CalendarServer/trunk/contrib/performance/stats.py	2010-08-19 00:25:10 UTC (rev 6124)
+++ CalendarServer/trunk/contrib/performance/stats.py	2010-08-19 00:25:21 UTC (rev 6125)
@@ -60,8 +60,15 @@
         statements = {}
         for (sql, interval) in data:
             statements.setdefault(sql, []).append(interval)
-        for s in statements:
-            print sum(statements[s]) / NANO, 'seconds:', s
+        
+        byTime = []
+        for statement, times in statements.iteritems():
+            byTime.append((sum(times), statement))
+        byTime.sort()
+        byTime.reverse()
 
+        for (time, statement) in byTime:
+            print time / NANO * 1000, 'ms:', statement.replace('\n', ' ')
+
 class Bytes(_Statistic):
     pass
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100818/343d733c/attachment.html>


More information about the calendarserver-changes mailing list