[CalendarServer-changes] [13752] CalendarServer/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Fri Jul 11 13:03:42 PDT 2014
Revision: 13752
http://trac.calendarserver.org//changeset/13752
Author: cdaboo at apple.com
Date: 2014-07-11 13:03:42 -0700 (Fri, 11 Jul 2014)
Log Message:
-----------
Fix sqlusage tool.
Modified Paths:
--------------
CalendarServer/trunk/conf/auth/accounts-test.xml
CalendarServer/trunk/conf/auth/generate_test_accounts.py
CalendarServer/trunk/contrib/performance/sqlusage/requests/httpTests.py
CalendarServer/trunk/contrib/performance/sqlusage/requests/multiget.py
CalendarServer/trunk/contrib/performance/sqlusage/requests/propfind.py
CalendarServer/trunk/contrib/performance/sqlusage/requests/propfind_invite.py
CalendarServer/trunk/contrib/performance/sqlusage/requests/query.py
CalendarServer/trunk/contrib/performance/sqlusage/requests/sync.py
CalendarServer/trunk/contrib/performance/sqlusage/sqlusage.py
Modified: CalendarServer/trunk/conf/auth/accounts-test.xml
===================================================================
--- CalendarServer/trunk/conf/auth/accounts-test.xml 2014-07-11 18:04:46 UTC (rev 13751)
+++ CalendarServer/trunk/conf/auth/accounts-test.xml 2014-07-11 20:03:42 UTC (rev 13752)
@@ -844,6 +844,14 @@
<email>user100 at example.com</email>
</record>
<record type="user">
+ <uid>10000000-0000-0000-0000-000000000101</uid>
+ <guid>10000000-0000-0000-0000-000000000101</guid>
+ <short-name>user101</short-name>
+ <password>user101</password>
+ <full-name>User 101</full-name>
+ <email>user101 at example.com</email>
+</record>
+<record type="user">
<uid>50000000-0000-0000-0000-000000000001</uid>
<guid>50000000-0000-0000-0000-000000000001</guid>
<short-name>public01</short-name>
Modified: CalendarServer/trunk/conf/auth/generate_test_accounts.py
===================================================================
--- CalendarServer/trunk/conf/auth/generate_test_accounts.py 2014-07-11 18:04:46 UTC (rev 13751)
+++ CalendarServer/trunk/conf/auth/generate_test_accounts.py 2014-07-11 20:03:42 UTC (rev 13752)
@@ -59,8 +59,8 @@
</record>
""".format(uid=uid, guid=guid, fullName=fullName))
-# user01-100
-for i in xrange(1, 501 if EXTRA_GROUPS else 101):
+# user01-101
+for i in xrange(1, 501 if EXTRA_GROUPS else 102):
out.write("""<record type="user">
<uid>{guid}</uid>
<guid>{guid}</guid>
Modified: CalendarServer/trunk/contrib/performance/sqlusage/requests/httpTests.py
===================================================================
--- CalendarServer/trunk/contrib/performance/sqlusage/requests/httpTests.py 2014-07-11 18:04:46 UTC (rev 13751)
+++ CalendarServer/trunk/contrib/performance/sqlusage/requests/httpTests.py 2014-07-11 20:03:42 UTC (rev 13752)
@@ -31,7 +31,7 @@
self.timing = timing
- def __init__(self, label, sessions, logFilePath):
+ def __init__(self, label, sessions, logFilePath, logFilePrefix):
"""
@param label: label used to identify the test
@type label: C{str}
@@ -39,6 +39,7 @@
self.label = label
self.sessions = sessions
self.logFilePath = logFilePath
+ self.logFilePrefix = logFilePrefix
self.result = None
@@ -95,7 +96,7 @@
offset = 0
while True:
if lines[offset] == "*** SQL Stats ***":
- if lines[offset + 2].split()[1] != "unlabeled":
+ if lines[offset + 2].startswith("Label: <"):
count = extractInt(lines[offset + 4])
rows = extractInt(lines[offset + 5])
timing = extractFloat(lines[offset + 6])
@@ -105,7 +106,8 @@
else:
self.result = HTTPTestBase.SQLResults(-1, -1, 0.0)
- with open("%s-%d-%s" % (self.logFilePath, event_count, self.label), "w") as f:
+ # Archive current sqlstats file
+ with open("%s-%s-%d-%s" % (self.logFilePath, self.logFilePrefix, event_count, self.label), "w") as f:
f.write(data)
Modified: CalendarServer/trunk/contrib/performance/sqlusage/requests/multiget.py
===================================================================
--- CalendarServer/trunk/contrib/performance/sqlusage/requests/multiget.py 2014-07-11 18:04:46 UTC (rev 13751)
+++ CalendarServer/trunk/contrib/performance/sqlusage/requests/multiget.py 2014-07-11 20:03:42 UTC (rev 13752)
@@ -26,8 +26,8 @@
A multiget operation
"""
- def __init__(self, label, sessions, logFilePath, count):
- super(MultigetTest, self).__init__(label, sessions, logFilePath)
+ def __init__(self, label, sessions, logFilePath, logFilePrefix, count):
+ super(MultigetTest, self).__init__(label, sessions, logFilePath, logFilePrefix)
self.count = count
Modified: CalendarServer/trunk/contrib/performance/sqlusage/requests/propfind.py
===================================================================
--- CalendarServer/trunk/contrib/performance/sqlusage/requests/propfind.py 2014-07-11 18:04:46 UTC (rev 13751)
+++ CalendarServer/trunk/contrib/performance/sqlusage/requests/propfind.py 2014-07-11 20:03:42 UTC (rev 13752)
@@ -25,8 +25,8 @@
A propfind operation
"""
- def __init__(self, label, sessions, logFilePath, depth=1):
- super(PropfindTest, self).__init__(label, sessions, logFilePath)
+ def __init__(self, label, sessions, logFilePath, logFilePrefix, depth=1):
+ super(PropfindTest, self).__init__(label, sessions, logFilePath, logFilePrefix)
self.depth = headers.Depth1 if depth == 1 else headers.Depth0
Modified: CalendarServer/trunk/contrib/performance/sqlusage/requests/propfind_invite.py
===================================================================
--- CalendarServer/trunk/contrib/performance/sqlusage/requests/propfind_invite.py 2014-07-11 18:04:46 UTC (rev 13751)
+++ CalendarServer/trunk/contrib/performance/sqlusage/requests/propfind_invite.py 2014-07-11 20:03:42 UTC (rev 13752)
@@ -26,8 +26,8 @@
A propfind operation
"""
- def __init__(self, label, sessions, logFilePath, depth=1):
- super(PropfindInviteTest, self).__init__(label, sessions, logFilePath)
+ def __init__(self, label, sessions, logFilePath, logFilePrefix, depth=1):
+ super(PropfindInviteTest, self).__init__(label, sessions, logFilePath, logFilePrefix)
self.depth = headers.Depth1 if depth == 1 else headers.Depth0
Modified: CalendarServer/trunk/contrib/performance/sqlusage/requests/query.py
===================================================================
--- CalendarServer/trunk/contrib/performance/sqlusage/requests/query.py 2014-07-11 18:04:46 UTC (rev 13751)
+++ CalendarServer/trunk/contrib/performance/sqlusage/requests/query.py 2014-07-11 20:03:42 UTC (rev 13752)
@@ -60,8 +60,8 @@
A sync operation
"""
- def __init__(self, label, sessions, logFilePath, count):
- super(QueryTest, self).__init__(label, sessions, logFilePath)
+ def __init__(self, label, sessions, logFilePath, logFilePrefix, count):
+ super(QueryTest, self).__init__(label, sessions, logFilePath, logFilePrefix)
self.count = count
Modified: CalendarServer/trunk/contrib/performance/sqlusage/requests/sync.py
===================================================================
--- CalendarServer/trunk/contrib/performance/sqlusage/requests/sync.py 2014-07-11 18:04:46 UTC (rev 13751)
+++ CalendarServer/trunk/contrib/performance/sqlusage/requests/sync.py 2014-07-11 20:03:42 UTC (rev 13752)
@@ -58,8 +58,8 @@
A sync operation
"""
- def __init__(self, label, sessions, logFilePath, full, count):
- super(SyncTest, self).__init__(label, sessions, logFilePath)
+ def __init__(self, label, sessions, logFilePath, logFilePrefix, full, count):
+ super(SyncTest, self).__init__(label, sessions, logFilePath, logFilePrefix)
self.full = full
self.count = count
self.synctoken = ""
Modified: CalendarServer/trunk/contrib/performance/sqlusage/sqlusage.py
===================================================================
--- CalendarServer/trunk/contrib/performance/sqlusage/sqlusage.py 2014-07-11 18:04:46 UTC (rev 13751)
+++ CalendarServer/trunk/contrib/performance/sqlusage/sqlusage.py 2014-07-11 20:03:42 UTC (rev 13752)
@@ -115,15 +115,15 @@
# Set of requests to execute
requests = [
- MultigetTest("mget-1" if self.compact else "multiget-1", sessions, self.logFilePath, 1),
- MultigetTest("mget-50" if self.compact else "multiget-50", sessions, self.logFilePath, 50),
- PropfindTest("prop-cal" if self.compact else "propfind-cal", sessions, self.logFilePath, 1),
- SyncTest("s-full" if self.compact else "sync-full", sessions, self.logFilePath, True, 0),
- SyncTest("s-1" if self.compact else "sync-1", sessions, self.logFilePath, False, 1),
- QueryTest("q-1" if self.compact else "query-1", sessions, self.logFilePath, 1),
- QueryTest("q-10" if self.compact else "query-10", sessions, self.logFilePath, 10),
- PutTest("put", sessions, self.logFilePath),
- InviteTest("invite", sessions, self.logFilePath),
+ MultigetTest("mget-1" if self.compact else "multiget-1", sessions, self.logFilePath, "event", 1),
+ MultigetTest("mget-50" if self.compact else "multiget-50", sessions, self.logFilePath, "event", 50),
+ PropfindTest("prop-cal" if self.compact else "propfind-cal", sessions, self.logFilePath, "event", 1),
+ SyncTest("s-full" if self.compact else "sync-full", sessions, self.logFilePath, "event", True, 0),
+ SyncTest("s-1" if self.compact else "sync-1", sessions, self.logFilePath, "event", False, 1),
+ QueryTest("q-1" if self.compact else "query-1", sessions, self.logFilePath, "event", 1),
+ QueryTest("q-10" if self.compact else "query-10", sessions, self.logFilePath, "event", 10),
+ PutTest("put", sessions, self.logFilePath, "event"),
+ InviteTest("invite", sessions, self.logFilePath, "event"),
]
self.requestLabels = [request.label for request in requests]
@@ -221,14 +221,14 @@
# Set of requests to execute
requests = [
- MultigetTest("mget-1" if self.compact else "multiget-1", sessions, self.logFilePath, 1),
- MultigetTest("mget-50" if self.compact else "multiget-50", sessions, self.logFilePath, 50),
- PropfindInviteTest("propfind", sessions, self.logFilePath, 1),
- SyncTest("s-full" if self.compact else "sync-full", sessions, self.logFilePath, True, 0),
- SyncTest("s-1" if self.compact else "sync-1", sessions, self.logFilePath, False, 1),
- QueryTest("q-1" if self.compact else "query-1", sessions, self.logFilePath, 1),
- QueryTest("q-10" if self.compact else "query-10", sessions, self.logFilePath, 10),
- PutTest("put", sessions, self.logFilePath),
+ MultigetTest("mget-1" if self.compact else "multiget-1", sessions, self.logFilePath, "share", 1),
+ MultigetTest("mget-50" if self.compact else "multiget-50", sessions, self.logFilePath, "share", 50),
+ PropfindInviteTest("propfind", sessions, self.logFilePath, "share", 1),
+ SyncTest("s-full" if self.compact else "sync-full", sessions, self.logFilePath, "share", True, 0),
+ SyncTest("s-1" if self.compact else "sync-1", sessions, self.logFilePath, "share", False, 1),
+ QueryTest("q-1" if self.compact else "query-1", sessions, self.logFilePath, "share", 1),
+ QueryTest("q-10" if self.compact else "query-10", sessions, self.logFilePath, "share", 10),
+ PutTest("put", sessions, self.logFilePath, "share"),
]
self.requestLabels = [request.label for request in requests]
@@ -286,7 +286,7 @@
for i in range(n - self.currentCount):
index = self.currentCount + i + 2
users.append("user%02d" % (index,))
- uids.append("urn:x-uid:user%02d" % (index,))
+ uids.append("urn:x-uid:10000000-0000-0000-0000-000000000%03d" % (index,))
session.addInvitees(URL(path=calendarhref), uids, True)
# Now accept each one
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140711/e69a8c9a/attachment-0001.html>
More information about the calendarserver-changes
mailing list