Update QoS to use right time units and stop showing misc.
authorAdam Chlipala <adamc@hcoop.net>
Sun, 9 Dec 2007 21:58:51 +0000 (21:58 +0000)
committerAdam Chlipala <adamc@hcoop.net>
Sun, 9 Dec 2007 21:58:51 +0000 (21:58 +0000)
qos.mlt
qos.sml

diff --git a/qos.mlt b/qos.mlt
index 47231b7..1212fe1 100644 (file)
--- a/qos.mlt
+++ b/qos.mlt
@@ -45,10 +45,10 @@ Refresh statistics to include the last <input name="days" size="7" value="<% day
 <tr> <td>Domains</td> <td><% #count (#domain stats) %></td> <td><% #minutes (#domain stats) %></td> </tr>
 <tr> <td>Mailing lists</td> <td><% #count (#mailingList stats) %></td> <td><% #minutes (#mailingList stats) %></td> </tr>
 <tr> <td>Security</td> <td><% #count (#sec stats) %></td> <td><% #minutes (#sec stats) %></td> </tr>
-<tr> <td>Miscellaneous</td> <td><% #count (#closed (#misc stats)) %></td> <td><% #minutes (#closed (#misc stats)) %></td> </tr>
+<!--tr> <td>Miscellaneous</td> <td><% #count (#closed (#misc stats)) %></td> <td><% #minutes (#closed (#misc stats)) %></td> </tr-->
 </table>
 
-<p>Additionally, <% #count (#pending (#misc stats)) %> miscellaneous support requests placed in this period have at some time been marked as pending or closed, and it took on average <% #minutes (#pending (#misc stats)) %> minutes to do so.</p>
+<!--p>Additionally, <% #count (#pending (#misc stats)) %> miscellaneous support requests placed in this period have at some time been marked as pending or closed, and it took on average <% #minutes (#pending (#misc stats)) %> minutes to do so.</p-->
 
 <% end %>
 
diff --git a/qos.sml b/qos.sml
index cd71246..ccdad10 100644 (file)
--- a/qos.sml
+++ b/qos.sml
@@ -62,18 +62,18 @@ fun reportCard days =
        fun gradeRow s = mkGradeRow (C.oneRow db s)
 
        fun default tab =
-           gradeRow ($`SELECT COUNT(*), AVG(cstamp - stamp)
+           gradeRow ($`SELECT COUNT(*), EXTRACT(MINUTE FROM AVG(cstamp - stamp))
                          FROM ^tab
                          WHERE stamp >= CURRENT_TIMESTAMP - interval '^(C.intToSql days) DAYS'
                             AND cstamp IS NOT NULL`)
     in
        {misc = {pending = gradeRow
-                ($`SELECT COUNT(*), AVG(COALESCE(pstamp, cstamp) - stamp)
+                ($`SELECT COUNT(*), EXTRACT(MINUTE FROM AVG(COALESCE(pstamp, cstamp) - stamp))
                      FROM SupIssue
                       WHERE stamp >= CURRENT_TIMESTAMP - interval '^(C.intToSql days) DAYS'
                         AND COALESCE(pstamp, cstamp) IS NOT NULL`),
                 closed = gradeRow
-                ($`SELECT COUNT(*), AVG(cstamp - stamp)
+                ($`SELECT COUNT(*), EXTRACT(MINUTE FROM AVG(cstamp - stamp))
                      FROM SupIssue
                      WHERE stamp >= CURRENT_TIMESTAMP - interval '^(C.intToSql days) DAYS'
                         AND cstamp IS NOT NULL`)},