[CalendarServer-changes] [11400] CalendarServer/trunk/contrib/performance/sqlusage

source_changes at macosforge.org source_changes at macosforge.org
Tue Jun 25 08:23:22 PDT 2013


Revision: 11400
          http://trac.calendarserver.org//changeset/11400
Author:   cdaboo at apple.com
Date:     2013-06-25 08:23:22 -0700 (Tue, 25 Jun 2013)
Log Message:
-----------
Keep track of the sqlstats file for each separate test so they can be examined after the fact if a particular test needs investigation.

Modified Paths:
--------------
    CalendarServer/trunk/contrib/performance/sqlusage/requests/httpTests.py
    CalendarServer/trunk/contrib/performance/sqlusage/sqlusage.py

Modified: CalendarServer/trunk/contrib/performance/sqlusage/requests/httpTests.py
===================================================================
--- CalendarServer/trunk/contrib/performance/sqlusage/requests/httpTests.py	2013-06-25 14:08:23 UTC (rev 11399)
+++ CalendarServer/trunk/contrib/performance/sqlusage/requests/httpTests.py	2013-06-25 15:23:22 UTC (rev 11400)
@@ -42,7 +42,7 @@
         self.result = None
 
 
-    def execute(self):
+    def execute(self, count):
         """
         Execute the HTTP request and read the results.
         """
@@ -50,7 +50,7 @@
         self.prepare()
         self.clearLog()
         self.doRequest()
-        self.collectResults()
+        self.collectResults(count)
         self.cleanup()
         return self.result
 
@@ -76,7 +76,7 @@
         raise NotImplementedError
 
 
-    def collectResults(self):
+    def collectResults(self, event_count):
         """
         Parse the server log file to extract the details we need.
         """
@@ -96,7 +96,10 @@
         timing = extractFloat(lines[6])
         self.result = HTTPTestBase.SQLResults(count, rows, timing)
 
+        with open("%s-%d-%s" % (self.logFilePath, event_count, self.label), "w") as f:
+            f.write(data)
 
+
     def cleanup(self):
         """
         Do some cleanup after the real request.

Modified: CalendarServer/trunk/contrib/performance/sqlusage/sqlusage.py
===================================================================
--- CalendarServer/trunk/contrib/performance/sqlusage/sqlusage.py	2013-06-25 14:08:23 UTC (rev 11399)
+++ CalendarServer/trunk/contrib/performance/sqlusage/sqlusage.py	2013-06-25 15:23:22 UTC (rev 11400)
@@ -135,7 +135,7 @@
             result = {}
             for request in requests:
                 print("  Test = %s" % (request.label,))
-                result[request.label] = request.execute()
+                result[request.label] = request.execute(count)
             self.results[count] = result
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130625/ebf2f458/attachment.html>


More information about the calendarserver-changes mailing list