<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[13752] CalendarServer/trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.calendarserver.org//changeset/13752">13752</a></dd>
<dt>Author</dt> <dd>cdaboo@apple.com</dd>
<dt>Date</dt> <dd>2014-07-11 13:03:42 -0700 (Fri, 11 Jul 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Fix sqlusage tool.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServertrunkconfauthaccountstestxml">CalendarServer/trunk/conf/auth/accounts-test.xml</a></li>
<li><a href="#CalendarServertrunkconfauthgenerate_test_accountspy">CalendarServer/trunk/conf/auth/generate_test_accounts.py</a></li>
<li><a href="#CalendarServertrunkcontribperformancesqlusagerequestshttpTestspy">CalendarServer/trunk/contrib/performance/sqlusage/requests/httpTests.py</a></li>
<li><a href="#CalendarServertrunkcontribperformancesqlusagerequestsmultigetpy">CalendarServer/trunk/contrib/performance/sqlusage/requests/multiget.py</a></li>
<li><a href="#CalendarServertrunkcontribperformancesqlusagerequestspropfindpy">CalendarServer/trunk/contrib/performance/sqlusage/requests/propfind.py</a></li>
<li><a href="#CalendarServertrunkcontribperformancesqlusagerequestspropfind_invitepy">CalendarServer/trunk/contrib/performance/sqlusage/requests/propfind_invite.py</a></li>
<li><a href="#CalendarServertrunkcontribperformancesqlusagerequestsquerypy">CalendarServer/trunk/contrib/performance/sqlusage/requests/query.py</a></li>
<li><a href="#CalendarServertrunkcontribperformancesqlusagerequestssyncpy">CalendarServer/trunk/contrib/performance/sqlusage/requests/sync.py</a></li>
<li><a href="#CalendarServertrunkcontribperformancesqlusagesqlusagepy">CalendarServer/trunk/contrib/performance/sqlusage/sqlusage.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServertrunkconfauthaccountstestxml"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/conf/auth/accounts-test.xml (13751 => 13752)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -844,6 +844,14 @@
</span><span class="cx">     &lt;email&gt;user100@example.com&lt;/email&gt;
</span><span class="cx"> &lt;/record&gt;
</span><span class="cx"> &lt;record type=&quot;user&quot;&gt;
</span><ins>+    &lt;uid&gt;10000000-0000-0000-0000-000000000101&lt;/uid&gt;
+    &lt;guid&gt;10000000-0000-0000-0000-000000000101&lt;/guid&gt;
+    &lt;short-name&gt;user101&lt;/short-name&gt;
+    &lt;password&gt;user101&lt;/password&gt;
+    &lt;full-name&gt;User 101&lt;/full-name&gt;
+    &lt;email&gt;user101@example.com&lt;/email&gt;
+&lt;/record&gt;
+&lt;record type=&quot;user&quot;&gt;
</ins><span class="cx">     &lt;uid&gt;50000000-0000-0000-0000-000000000001&lt;/uid&gt;
</span><span class="cx">     &lt;guid&gt;50000000-0000-0000-0000-000000000001&lt;/guid&gt;
</span><span class="cx">     &lt;short-name&gt;public01&lt;/short-name&gt;
</span></span></pre></div>
<a id="CalendarServertrunkconfauthgenerate_test_accountspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/conf/auth/generate_test_accounts.py (13751 => 13752)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -59,8 +59,8 @@
</span><span class="cx"> &lt;/record&gt;
</span><span class="cx"> &quot;&quot;&quot;.format(uid=uid, guid=guid, fullName=fullName))
</span><span class="cx"> 
</span><del>-# user01-100
-for i in xrange(1, 501 if EXTRA_GROUPS else 101):
</del><ins>+# user01-101
+for i in xrange(1, 501 if EXTRA_GROUPS else 102):
</ins><span class="cx">     out.write(&quot;&quot;&quot;&lt;record type=&quot;user&quot;&gt;
</span><span class="cx">     &lt;uid&gt;{guid}&lt;/uid&gt;
</span><span class="cx">     &lt;guid&gt;{guid}&lt;/guid&gt;
</span></span></pre></div>
<a id="CalendarServertrunkcontribperformancesqlusagerequestshttpTestspy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/contrib/performance/sqlusage/requests/httpTests.py (13751 => 13752)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx">             self.timing = timing
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-    def __init__(self, label, sessions, logFilePath):
</del><ins>+    def __init__(self, label, sessions, logFilePath, logFilePrefix):
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         @param label: label used to identify the test
</span><span class="cx">         @type label: C{str}
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx">         self.label = label
</span><span class="cx">         self.sessions = sessions
</span><span class="cx">         self.logFilePath = logFilePath
</span><ins>+        self.logFilePrefix = logFilePrefix
</ins><span class="cx">         self.result = None
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -95,7 +96,7 @@
</span><span class="cx">         offset = 0
</span><span class="cx">         while True:
</span><span class="cx">             if lines[offset] == &quot;*** SQL Stats ***&quot;:
</span><del>-                if lines[offset + 2].split()[1] != &quot;unlabeled&quot;:
</del><ins>+                if lines[offset + 2].startswith(&quot;Label: &lt;&quot;):
</ins><span class="cx">                     count = extractInt(lines[offset + 4])
</span><span class="cx">                     rows = extractInt(lines[offset + 5])
</span><span class="cx">                     timing = extractFloat(lines[offset + 6])
</span><span class="lines">@@ -105,7 +106,8 @@
</span><span class="cx">         else:
</span><span class="cx">             self.result = HTTPTestBase.SQLResults(-1, -1, 0.0)
</span><span class="cx"> 
</span><del>-        with open(&quot;%s-%d-%s&quot; % (self.logFilePath, event_count, self.label), &quot;w&quot;) as f:
</del><ins>+        # Archive current sqlstats file
+        with open(&quot;%s-%s-%d-%s&quot; % (self.logFilePath, self.logFilePrefix, event_count, self.label), &quot;w&quot;) as f:
</ins><span class="cx">             f.write(data)
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServertrunkcontribperformancesqlusagerequestsmultigetpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/contrib/performance/sqlusage/requests/multiget.py (13751 => 13752)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -26,8 +26,8 @@
</span><span class="cx">     A multiget operation
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx"> 
</span><del>-    def __init__(self, label, sessions, logFilePath, count):
-        super(MultigetTest, self).__init__(label, sessions, logFilePath)
</del><ins>+    def __init__(self, label, sessions, logFilePath, logFilePrefix, count):
+        super(MultigetTest, self).__init__(label, sessions, logFilePath, logFilePrefix)
</ins><span class="cx">         self.count = count
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServertrunkcontribperformancesqlusagerequestspropfindpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/contrib/performance/sqlusage/requests/propfind.py (13751 => 13752)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -25,8 +25,8 @@
</span><span class="cx">     A propfind operation
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx"> 
</span><del>-    def __init__(self, label, sessions, logFilePath, depth=1):
-        super(PropfindTest, self).__init__(label, sessions, logFilePath)
</del><ins>+    def __init__(self, label, sessions, logFilePath, logFilePrefix, depth=1):
+        super(PropfindTest, self).__init__(label, sessions, logFilePath, logFilePrefix)
</ins><span class="cx">         self.depth = headers.Depth1 if depth == 1 else headers.Depth0
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServertrunkcontribperformancesqlusagerequestspropfind_invitepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/contrib/performance/sqlusage/requests/propfind_invite.py (13751 => 13752)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -26,8 +26,8 @@
</span><span class="cx">     A propfind operation
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx"> 
</span><del>-    def __init__(self, label, sessions, logFilePath, depth=1):
-        super(PropfindInviteTest, self).__init__(label, sessions, logFilePath)
</del><ins>+    def __init__(self, label, sessions, logFilePath, logFilePrefix, depth=1):
+        super(PropfindInviteTest, self).__init__(label, sessions, logFilePath, logFilePrefix)
</ins><span class="cx">         self.depth = headers.Depth1 if depth == 1 else headers.Depth0
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServertrunkcontribperformancesqlusagerequestsquerypy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/contrib/performance/sqlusage/requests/query.py (13751 => 13752)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -60,8 +60,8 @@
</span><span class="cx">     A sync operation
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx"> 
</span><del>-    def __init__(self, label, sessions, logFilePath, count):
-        super(QueryTest, self).__init__(label, sessions, logFilePath)
</del><ins>+    def __init__(self, label, sessions, logFilePath, logFilePrefix, count):
+        super(QueryTest, self).__init__(label, sessions, logFilePath, logFilePrefix)
</ins><span class="cx">         self.count = count
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServertrunkcontribperformancesqlusagerequestssyncpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/contrib/performance/sqlusage/requests/sync.py (13751 => 13752)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -58,8 +58,8 @@
</span><span class="cx">     A sync operation
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx"> 
</span><del>-    def __init__(self, label, sessions, logFilePath, full, count):
-        super(SyncTest, self).__init__(label, sessions, logFilePath)
</del><ins>+    def __init__(self, label, sessions, logFilePath, logFilePrefix, full, count):
+        super(SyncTest, self).__init__(label, sessions, logFilePath, logFilePrefix)
</ins><span class="cx">         self.full = full
</span><span class="cx">         self.count = count
</span><span class="cx">         self.synctoken = &quot;&quot;
</span></span></pre></div>
<a id="CalendarServertrunkcontribperformancesqlusagesqlusagepy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/contrib/performance/sqlusage/sqlusage.py (13751 => 13752)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -115,15 +115,15 @@
</span><span class="cx"> 
</span><span class="cx">         # Set of requests to execute
</span><span class="cx">         requests = [
</span><del>-            MultigetTest(&quot;mget-1&quot; if self.compact else &quot;multiget-1&quot;, sessions, self.logFilePath, 1),
-            MultigetTest(&quot;mget-50&quot; if self.compact else &quot;multiget-50&quot;, sessions, self.logFilePath, 50),
-            PropfindTest(&quot;prop-cal&quot; if self.compact else &quot;propfind-cal&quot;, sessions, self.logFilePath, 1),
-            SyncTest(&quot;s-full&quot; if self.compact else &quot;sync-full&quot;, sessions, self.logFilePath, True, 0),
-            SyncTest(&quot;s-1&quot; if self.compact else &quot;sync-1&quot;, sessions, self.logFilePath, False, 1),
-            QueryTest(&quot;q-1&quot; if self.compact else &quot;query-1&quot;, sessions, self.logFilePath, 1),
-            QueryTest(&quot;q-10&quot; if self.compact else &quot;query-10&quot;, sessions, self.logFilePath, 10),
-            PutTest(&quot;put&quot;, sessions, self.logFilePath),
-            InviteTest(&quot;invite&quot;, sessions, self.logFilePath),
</del><ins>+            MultigetTest(&quot;mget-1&quot; if self.compact else &quot;multiget-1&quot;, sessions, self.logFilePath, &quot;event&quot;, 1),
+            MultigetTest(&quot;mget-50&quot; if self.compact else &quot;multiget-50&quot;, sessions, self.logFilePath, &quot;event&quot;, 50),
+            PropfindTest(&quot;prop-cal&quot; if self.compact else &quot;propfind-cal&quot;, sessions, self.logFilePath, &quot;event&quot;, 1),
+            SyncTest(&quot;s-full&quot; if self.compact else &quot;sync-full&quot;, sessions, self.logFilePath, &quot;event&quot;, True, 0),
+            SyncTest(&quot;s-1&quot; if self.compact else &quot;sync-1&quot;, sessions, self.logFilePath, &quot;event&quot;, False, 1),
+            QueryTest(&quot;q-1&quot; if self.compact else &quot;query-1&quot;, sessions, self.logFilePath, &quot;event&quot;, 1),
+            QueryTest(&quot;q-10&quot; if self.compact else &quot;query-10&quot;, sessions, self.logFilePath, &quot;event&quot;, 10),
+            PutTest(&quot;put&quot;, sessions, self.logFilePath, &quot;event&quot;),
+            InviteTest(&quot;invite&quot;, sessions, self.logFilePath, &quot;event&quot;),
</ins><span class="cx">         ]
</span><span class="cx">         self.requestLabels = [request.label for request in requests]
</span><span class="cx"> 
</span><span class="lines">@@ -221,14 +221,14 @@
</span><span class="cx"> 
</span><span class="cx">         # Set of requests to execute
</span><span class="cx">         requests = [
</span><del>-            MultigetTest(&quot;mget-1&quot; if self.compact else &quot;multiget-1&quot;, sessions, self.logFilePath, 1),
-            MultigetTest(&quot;mget-50&quot; if self.compact else &quot;multiget-50&quot;, sessions, self.logFilePath, 50),
-            PropfindInviteTest(&quot;propfind&quot;, sessions, self.logFilePath, 1),
-            SyncTest(&quot;s-full&quot; if self.compact else &quot;sync-full&quot;, sessions, self.logFilePath, True, 0),
-            SyncTest(&quot;s-1&quot; if self.compact else &quot;sync-1&quot;, sessions, self.logFilePath, False, 1),
-            QueryTest(&quot;q-1&quot; if self.compact else &quot;query-1&quot;, sessions, self.logFilePath, 1),
-            QueryTest(&quot;q-10&quot; if self.compact else &quot;query-10&quot;, sessions, self.logFilePath, 10),
-            PutTest(&quot;put&quot;, sessions, self.logFilePath),
</del><ins>+            MultigetTest(&quot;mget-1&quot; if self.compact else &quot;multiget-1&quot;, sessions, self.logFilePath, &quot;share&quot;, 1),
+            MultigetTest(&quot;mget-50&quot; if self.compact else &quot;multiget-50&quot;, sessions, self.logFilePath, &quot;share&quot;, 50),
+            PropfindInviteTest(&quot;propfind&quot;, sessions, self.logFilePath, &quot;share&quot;, 1),
+            SyncTest(&quot;s-full&quot; if self.compact else &quot;sync-full&quot;, sessions, self.logFilePath, &quot;share&quot;, True, 0),
+            SyncTest(&quot;s-1&quot; if self.compact else &quot;sync-1&quot;, sessions, self.logFilePath, &quot;share&quot;, False, 1),
+            QueryTest(&quot;q-1&quot; if self.compact else &quot;query-1&quot;, sessions, self.logFilePath, &quot;share&quot;, 1),
+            QueryTest(&quot;q-10&quot; if self.compact else &quot;query-10&quot;, sessions, self.logFilePath, &quot;share&quot;, 10),
+            PutTest(&quot;put&quot;, sessions, self.logFilePath, &quot;share&quot;),
</ins><span class="cx">         ]
</span><span class="cx">         self.requestLabels = [request.label for request in requests]
</span><span class="cx"> 
</span><span class="lines">@@ -286,7 +286,7 @@
</span><span class="cx">         for i in range(n - self.currentCount):
</span><span class="cx">             index = self.currentCount + i + 2
</span><span class="cx">             users.append(&quot;user%02d&quot; % (index,))
</span><del>-            uids.append(&quot;urn:x-uid:user%02d&quot; % (index,))
</del><ins>+            uids.append(&quot;urn:x-uid:10000000-0000-0000-0000-000000000%03d&quot; % (index,))
</ins><span class="cx">         session.addInvitees(URL(path=calendarhref), uids, True)
</span><span class="cx"> 
</span><span class="cx">         # Now accept each one
</span></span></pre>
</div>
</div>

</body>
</html>