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

source_changes at macosforge.org source_changes at macosforge.org
Fri Dec 3 10:05:35 PST 2010


Revision: 6669
          http://trac.macosforge.org/projects/calendarserver/changeset/6669
Author:   exarkun at twistedmatrix.com
Date:     2010-12-03 10:05:31 -0800 (Fri, 03 Dec 2010)
Log Message:
-----------
A report command to just dump the SQL statements executed during one sample, in the order they were executed.

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

Modified: CalendarServer/trunk/contrib/performance/stats.py
===================================================================
--- CalendarServer/trunk/contrib/performance/stats.py	2010-12-02 22:16:23 UTC (rev 6668)
+++ CalendarServer/trunk/contrib/performance/stats.py	2010-12-03 18:05:31 UTC (rev 6669)
@@ -97,7 +97,7 @@
 
 
 class SQLDuration(_Statistic):
-    commands = ['summarize', 'statements']
+    commands = ['summarize', 'statements', 'transcript']
 
     def _is_literal(self, token):
         if sqlparse.tokens.is_token_subtype(token.ttype, sqlparse.tokens.Literal):
@@ -185,6 +185,14 @@
                 print row % (time, time / count, count, statement)
 
 
+    def transcript(self, samples):
+        statements = []
+        data = samples[len(samples) / 2]
+        for (sql, interval) in data:
+            statements.append(self.normalize(sql))
+        return '\n'.join(statements) + '\n'
+            
+
 class Bytes(_Statistic):
     def squash(self, samples):
         return [sum(bytes) for bytes in samples]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20101203/3583fdc8/attachment.html>


More information about the calendarserver-changes mailing list