<!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>[13488] 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/13488">13488</a></dd>
<dt>Author</dt> <dd>cdaboo@apple.com</dd>
<dt>Date</dt> <dd>2014-05-16 11:09:01 -0700 (Fri, 16 May 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Display additional job tracking details in the dashboard.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServertrunkcalendarservertoolsdashboardpy">CalendarServer/trunk/calendarserver/tools/dashboard.py</a></li>
<li><a href="#CalendarServertrunkrequirementsstabletxt">CalendarServer/trunk/requirements-stable.txt</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServertrunkcalendarservertoolsdashboardpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/calendarserver/tools/dashboard.py (13487 => 13488)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/calendarserver/tools/dashboard.py        2014-05-16 18:08:02 UTC (rev 13487)
+++ CalendarServer/trunk/calendarserver/tools/dashboard.py        2014-05-16 18:09:01 UTC (rev 13488)
</span><span class="lines">@@ -454,19 +454,19 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class WorkWindow(BaseWindow):
</del><ins>+class JobsWindow(BaseWindow):
</ins><span class="cx">     &quot;&quot;&quot;
</span><span class="cx">     Display the status of the server's job queue.
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx">     help = &quot;display server jobs&quot;
</span><span class="cx">     clientItem = &quot;jobs&quot;
</span><del>-    FORMAT_WIDTH = 78
</del><ins>+    FORMAT_WIDTH = 98
</ins><span class="cx"> 
</span><span class="cx">     def makeWindow(self, top=0, left=0):
</span><span class="cx">         nlines = defaultIfNone(self.readItem(&quot;jobcount&quot;), 0)
</span><span class="cx">         self.rowCount = nlines
</span><del>-        self._createWindow(&quot;Jobs&quot;, self.rowCount + 5, ncols=self.FORMAT_WIDTH, begin_y=top, begin_x=left)
</del><ins>+        self._createWindow(&quot;Jobs&quot;, self.rowCount + 6, ncols=self.FORMAT_WIDTH, begin_y=top, begin_x=left)
</ins><span class="cx">         return self
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -487,35 +487,52 @@
</span><span class="cx"> 
</span><span class="cx">         x = 1
</span><span class="cx">         y = 1
</span><del>-        s = &quot; {:&lt;40}{:&gt;8}{:&gt;10}{:&gt;8}{:&gt;8} &quot;.format(&quot;Work Type&quot;, &quot;Count&quot;, &quot;Assigned&quot;, &quot;Failed&quot;, &quot;Overdue&quot;)
</del><ins>+        s1 = &quot; {:&lt;40}{:&gt;8}{:&gt;10}{:&gt;8}{:&gt;8}{:&gt;10}{:&gt;10} &quot;.format(
+            &quot;Work Type&quot;, &quot;Queued&quot;, &quot;Assigned&quot;, &quot;Late&quot;, &quot;Failed&quot;, &quot;Completed&quot;, &quot;Av-Time&quot;,
+        )
+        s2 = &quot; {:&lt;40}{:&gt;8}{:&gt;10}{:&gt;8}{:&gt;8}{:&gt;10}{:&gt;10} &quot;.format(
+            &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;&quot;, &quot;(ms)&quot;,
+        )
</ins><span class="cx">         if self.usesCurses:
</span><del>-            self.window.addstr(y, x, s, curses.A_REVERSE)
</del><ins>+            self.window.addstr(y, x, s1, curses.A_REVERSE)
+            self.window.addstr(y + 1, x, s2, curses.A_REVERSE)
</ins><span class="cx">         else:
</span><del>-            print(s)
-        y += 1
-        total_count = 0
</del><ins>+            print(s1)
+            print(s2)
+        y += 2
+        total_queued = 0
</ins><span class="cx">         total_assigned = 0
</span><ins>+        total_late = 0
</ins><span class="cx">         total_failed = 0
</span><del>-        total_overdue = 0
</del><ins>+        total_completed = 0
+        total_time = 0.0
</ins><span class="cx">         for work_type, details in sorted(records.items(), key=lambda x: x[0]):
</span><del>-            count, assigned, failed, overdue = details
-            total_count += count
-            total_assigned += assigned
-            total_failed += failed
-            total_overdue += overdue
</del><ins>+            total_queued += details[&quot;queued&quot;]
+            total_assigned += details[&quot;assigned&quot;]
+            total_late += details[&quot;late&quot;]
+            total_failed += details[&quot;failed&quot;]
+            total_completed += details[&quot;completed&quot;]
+            total_time += details[&quot;time&quot;]
</ins><span class="cx">             changed = (
</span><span class="cx">                 work_type in self.lastResult and
</span><del>-                self.lastResult[work_type][0] != count
</del><ins>+                self.lastResult[work_type][&quot;queued&quot;] != details[&quot;queued&quot;]
</ins><span class="cx">             )
</span><del>-            s = &quot;{}{:&lt;40}{:&gt;8}{:&gt;10}{:&gt;8}{:&gt;8} &quot;.format(
-                &quot;&gt;&quot; if count else &quot; &quot;, work_type, count, assigned, failed, overdue
</del><ins>+            s = &quot;{}{:&lt;40}{:&gt;8}{:&gt;10}{:&gt;8}{:&gt;8}{:&gt;10}{:&gt;10.1f} &quot;.format(
+                &quot;&gt;&quot; if details[&quot;queued&quot;] else &quot; &quot;,
+                work_type,
+                details[&quot;queued&quot;],
+                details[&quot;assigned&quot;],
+                details[&quot;late&quot;],
+                details[&quot;failed&quot;],
+                details[&quot;completed&quot;],
+                safeDivision(details[&quot;time&quot;], details[&quot;completed&quot;], 1000.0)
</ins><span class="cx">             )
</span><span class="cx">             try:
</span><span class="cx">                 if self.usesCurses:
</span><span class="cx">                     self.window.addstr(
</span><span class="cx">                         y, x, s,
</span><span class="cx">                         curses.A_REVERSE if changed else (
</span><del>-                            curses.A_BOLD if count else curses.A_NORMAL
</del><ins>+                            curses.A_BOLD if details[&quot;queued&quot;] else curses.A_NORMAL
</ins><span class="cx">                         )
</span><span class="cx">                     )
</span><span class="cx">                 else:
</span><span class="lines">@@ -524,7 +541,15 @@
</span><span class="cx">                 pass
</span><span class="cx">             y += 1
</span><span class="cx"> 
</span><del>-        s = &quot; {:&lt;40}{:&gt;8}{:&gt;10}{:&gt;8}{:&gt;8} &quot;.format(&quot;Total:&quot;, total_count, total_assigned, total_failed, total_overdue)
</del><ins>+        s = &quot; {:&lt;40}{:&gt;8}{:&gt;10}{:&gt;8}{:&gt;8}{:&gt;10}{:&gt;10.1f} &quot;.format(
+            &quot;Total:&quot;,
+            total_queued,
+            total_assigned,
+            total_failed,
+            total_late,
+            total_completed,
+            safeDivision(total_time, total_completed, 1000.0)
+        )
</ins><span class="cx">         if self.usesCurses:
</span><span class="cx">             self.window.hline(y, x, &quot;-&quot;, self.FORMAT_WIDTH - 2)
</span><span class="cx">             y += 1
</span><span class="lines">@@ -634,7 +659,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class SlotsWindow(BaseWindow):
</del><ins>+class HTTPSlotsWindow(BaseWindow):
</ins><span class="cx">     &quot;&quot;&quot;
</span><span class="cx">     Displays the status of the server's master process worker slave slots.
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="lines">@@ -820,7 +845,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> 
</span><del>-class StatsWindow(BaseWindow):
</del><ins>+class RequestStatsWindow(BaseWindow):
</ins><span class="cx">     &quot;&quot;&quot;
</span><span class="cx">     Displays the status of the server's master process worker slave slots.
</span><span class="cx">     &quot;&quot;&quot;
</span><span class="lines">@@ -895,10 +920,10 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> Dashboard.registerWindow(SystemWindow, &quot;s&quot;)
</span><del>-Dashboard.registerWindow(StatsWindow, &quot;r&quot;)
-Dashboard.registerWindow(WorkWindow, &quot;j&quot;)
</del><ins>+Dashboard.registerWindow(RequestStatsWindow, &quot;r&quot;)
+Dashboard.registerWindow(JobsWindow, &quot;j&quot;)
</ins><span class="cx"> Dashboard.registerWindow(AssignmentsWindow, &quot;w&quot;)
</span><del>-Dashboard.registerWindow(SlotsWindow, &quot;c&quot;)
</del><ins>+Dashboard.registerWindow(HTTPSlotsWindow, &quot;c&quot;)
</ins><span class="cx"> Dashboard.registerWindow(HelpWindow, &quot;h&quot;)
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre></div>
<a id="CalendarServertrunkrequirementsstabletxt"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/requirements-stable.txt (13487 => 13488)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/requirements-stable.txt        2014-05-16 18:08:02 UTC (rev 13487)
+++ CalendarServer/trunk/requirements-stable.txt        2014-05-16 18:09:01 UTC (rev 13488)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> # For CalendarServer development, don't try to get these projects from PyPI; use svn.
</span><span class="cx"> 
</span><span class="cx"> -e .
</span><del>--e svn+http://svn.calendarserver.org/repository/calendarserver/twext/trunk@13483#egg=twextpy
</del><ins>+-e svn+http://svn.calendarserver.org/repository/calendarserver/twext/trunk@13486#egg=twextpy
</ins><span class="cx"> -e svn+http://svn.calendarserver.org/repository/calendarserver/PyKerberos/trunk@13420#egg=kerberos
</span><span class="cx"> -e svn+http://svn.calendarserver.org/repository/calendarserver/PyCalendar/trunk@13420#egg=pycalendar
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>