[CalendarServer-changes] [11818] CalendarServer/trunk/contrib/performance/sqlusage/requests/ httpTests.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 12 11:25:18 PDT 2014


Revision: 11818
          http://trac.calendarserver.org//changeset/11818
Author:   cdaboo at apple.com
Date:     2013-10-16 12:21:48 -0700 (Wed, 16 Oct 2013)
Log Message:
-----------
Need to ignore unlabeled SQL statements.

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

Modified: CalendarServer/trunk/contrib/performance/sqlusage/requests/httpTests.py
===================================================================
--- CalendarServer/trunk/contrib/performance/sqlusage/requests/httpTests.py	2013-10-15 23:24:11 UTC (rev 11817)
+++ CalendarServer/trunk/contrib/performance/sqlusage/requests/httpTests.py	2013-10-16 19:21:48 UTC (rev 11818)
@@ -89,12 +89,21 @@
             pos = line.find(": ")
             return float(line[pos + 2:])
 
+        # Need to skip over stats that are unlabeled
         data = open(self.logFilePath).read()
         lines = data.splitlines()
-        count = extractInt(lines[4])
-        rows = extractInt(lines[5])
-        timing = extractFloat(lines[6])
-        self.result = HTTPTestBase.SQLResults(count, rows, timing)
+        offset = 0
+        while True:
+            if lines[offset] == "*** SQL Stats ***":
+                if lines[offset + 2].split()[1] != "unlabeled":
+                    count = extractInt(lines[offset + 4])
+                    rows = extractInt(lines[offset + 5])
+                    timing = extractFloat(lines[offset + 6])
+                    self.result = HTTPTestBase.SQLResults(count, rows, timing)
+                    break
+            offset += 1
+        else:
+            self.result = HTTPTestBase.SQLResults(-1, -1, 0.0)
 
         with open("%s-%d-%s" % (self.logFilePath, event_count, self.label), "w") as f:
             f.write(data)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/92c3db9c/attachment.html>


More information about the calendarserver-changes mailing list