[ARVADOS] updated: 4cc70d306f608b6b7ca5076a6d066bb3e1c7bf2b

git at public.curoverse.com git at public.curoverse.com
Mon Jun 16 15:54:12 EDT 2014


Summary of changes:
 .../workbench/app/assets/javascripts/log_viewer.js | 64 +++++++++++++++-------
 .../app/assets/stylesheets/log_viewer.scss         |  8 ++-
 apps/workbench/app/views/jobs/_show_log.html.erb   | 32 +++++++----
 3 files changed, 71 insertions(+), 33 deletions(-)

       via  4cc70d306f608b6b7ca5076a6d066bb3e1c7bf2b (commit)
      from  189ce25a32a5916194597665435b269192a9baec (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 4cc70d306f608b6b7ca5076a6d066bb3e1c7bf2b
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Mon Jun 16 19:54:07 2014 +0000

    2883: Added node slots as its own column.

diff --git a/apps/workbench/app/assets/javascripts/log_viewer.js b/apps/workbench/app/assets/javascripts/log_viewer.js
index c9e871b..2e2fca2 100644
--- a/apps/workbench/app/assets/javascripts/log_viewer.js
+++ b/apps/workbench/app/assets/javascripts/log_viewer.js
@@ -16,6 +16,7 @@ function addToLogViewer(logViewer, lines, taskState) {
             var message = v[12];
             var type = "";
             var node = "";
+            var slot = "";
             if (v11 !== "") {
                 if (!taskState.hasOwnProperty(v11)) {
                     taskState[v11] = {};
@@ -32,25 +33,32 @@ function addToLogViewer(logViewer, lines, taskState) {
                         type = "task-output";
                     }
                 } else {
-                    if (/^success /.test(message)) {
+                    var m;
+                    if (m = /^success in (\d+) second/.exec(message)) {
                         taskState[v11].outcome = "success";
+                        taskState[v11].runtime = Number(m[1]);
                         taskState.success_count += 1;
+                        console.log(taskState[v11].runtime);
                     }
-                    else if (/^failure /.test(message)) {
+                    else if (m = /^failure \([^\)]+\) after (\d+) second/.exec(message)) {
                         taskState[v11].outcome = "failure";
+                        taskState[v11].runtime = Number(m[1]);
                         taskState.failure_count += 1;
+                        console.log(taskState[v11].runtime);
                     }
-                    else {
-                        var child = message.match(/^child \d+ started on (.*)/);
-                        if (child != null) {
-                            taskState[v11].node = child[1];
-                            for (var i in logViewer.items) {
-                                if (i > 0) {
-                                    var val = logViewer.items[i].values();
-                                    if (val.taskid === v11) {
-                                        val.node = child[1];
-                                        logViewer.items[i].values(val);
-                                    }
+                    else if (m = /^child \d+ started on ([^.]*)\.(\d+)/.exec(message)) {
+                        taskState[v11].node = m[1];
+                        taskState[v11].slot = m[2];
+                        if (taskState.nodes.indexOf(m[1], 0) == -1) {
+                            taskState.nodes.push(m[1]);
+                        }
+                        for (var i in logViewer.items) {
+                            if (i > 0) {
+                                var val = logViewer.items[i].values();
+                                if (val.taskid === v11) {
+                                    val.node = m[1];
+                                    val.slot = m[2];
+                                    logViewer.items[i].values(val);
                                 }
                             }
                         }
@@ -58,6 +66,7 @@ function addToLogViewer(logViewer, lines, taskState) {
                     type = "task-dispatch";
                 }
                 node = taskState[v11].node;
+                slot = taskState[v11].slot;
             } else {
                 if (/^status: /.test(message)) {
                     type = "job-status";
@@ -73,6 +82,7 @@ function addToLogViewer(logViewer, lines, taskState) {
                 timestamp: ts.toLocaleDateString() + " " + ts.toLocaleTimeString(),
                 taskid: v11,
                 node: node,
+                slot: slot,
                 message: message,
                 type: type
             });
@@ -140,6 +150,15 @@ function sortByNode(a, b, opt) {
         }
     }
 
+    if (aa["slot"] !== "" && bb["slot"] !== "") {
+        if (aa["slot"] > bb["slot"]) {
+            return 1;
+        }
+        if (aa["slot"] < bb["slot"]) {
+            return -1;
+        }
+    }
+
     return sortById(a, b, opt);
 }
 
@@ -149,9 +168,9 @@ function dumbPluralize(n, s, p) {
         p = "s";
     }
     if (n == 0 || n > 1) {
-        return (s + p);
+        return n + " " + (s + p);
     } else {
-        return s;
+        return n + " " + s;
     }
 }
 
@@ -183,18 +202,21 @@ function generateJobOverview(id, logViewer, taskState) {
 
         var tcount = taskState.success_count + taskState.failure_count;
 
-        html += ".  " + tcount + dumbPluralize(tcount, " task") + " completed in ";
+        html += ".  " + dumbPluralize(tcount, " task") + " completed in ";
         if (hours > 0) {
-            html += hours + dumbPluralize(hours, " hour");
+            html += dumbPluralize(hours, " hour");
         }
         if (minutes > 0) {
-            html += " " + minutes + dumbPluralize(minutes, " minute");
+            html += " " + dumbPluralize(minutes, " minute");
         }
         if (seconds > 0) {
-            html += " " + seconds + dumbPluralize(seconds, " second");
+            html += " " + dumbPluralize(seconds, " second");
         }
-        html += ".  " + taskState.success_count + dumbPluralize(taskState.success_count, " success", "es");
-        html += ", " + taskState.failure_count + dumbPluralize(taskState.failure_count, " failure");
+
+        html += " using " + dumbPluralize(taskState.nodes.length, " node");
+
+        html += ".  " + dumbPluralize(taskState.success_count, " success", "es");
+        html += ", " + dumbPluralize(taskState.failure_count, " failure");
 
         html += ".  Completed at " + last.values().timestamp;
         html += "</div>";
diff --git a/apps/workbench/app/assets/stylesheets/log_viewer.scss b/apps/workbench/app/assets/stylesheets/log_viewer.scss
index 55a0df0..427fafb 100644
--- a/apps/workbench/app/assets/stylesheets/log_viewer.scss
+++ b/apps/workbench/app/assets/stylesheets/log_viewer.scss
@@ -17,11 +17,14 @@
      width: 8em;
    }
    th.taskid {
-     width: 3em;
+     width: 4em;
    }
    th.node {
      width: 8em;
    }
+   th.slot {
+     width: 3em;
+   }
    th.message {
      width: auto;
    }
@@ -37,6 +40,9 @@
    td.taskid {
      text-align: right;
    }
+   td.slot {
+     text-align: right;
+   }
    td.message {
      word-wrap: break-word;
    }
diff --git a/apps/workbench/app/views/jobs/_show_log.html.erb b/apps/workbench/app/views/jobs/_show_log.html.erb
index a224bc1..2b066e0 100644
--- a/apps/workbench/app/views/jobs/_show_log.html.erb
+++ b/apps/workbench/app/views/jobs/_show_log.html.erb
@@ -5,7 +5,7 @@ var logViewer = new List('log-viewer', {
   page: 10000,
 });
 
-var taskState = {"success_count": 0, "failure_count": 0};
+var taskState = {"success_count": 0, "failure_count": 0, "nodes": []};
 
 var makeFilter = function() {
   var pass = [];
@@ -19,8 +19,9 @@ var makeFilter = function() {
     var v = false;
     if (item.values().taskid !== "") {
       for (a in pass) {
-        if (pass[a] == "successful-tasks" && taskState[item.values().taskid].outcome == "success") { v = true; }
-        if (pass[a] == "failed-tasks" && taskState[item.values().taskid].outcome == "failure") { v = true; }
+        if (pass[a] == "all-tasks") { v = true; }
+        else if (pass[a] == "successful-tasks" && taskState[item.values().taskid].outcome == "success") { v = true; }
+        else if (pass[a] == "failed-tasks" && taskState[item.values().taskid].outcome == "failure") { v = true; }
       }
     } else {
       v = true;
@@ -105,7 +106,19 @@ $("#sort-by-node").on("change", function() {
     <div class="radio-inline log-viewer-button">
       <label><input id="sort-by-task" type="radio" name="sort-radio" > Sort by task</label>
     </div>
+  </div>
+
+  <div>
+    <div class="radio-inline log-viewer-button" style="margin-left: 10px">
+      <label><input id="show-all-tasks" type="radio" name="show-tasks-group" checked="true" class="toggle-filter"> Show all tasks</label>
+    </div>
+    <div class="radio-inline log-viewer-button">
+      <label><input id="show-successful-tasks" type="radio" name="show-tasks-group" class="toggle-filter"> Only successful tasks</label>
+    </div>
+    <div class="radio-inline log-viewer-button">
+      <label><input id="show-failed-tasks" type="radio" name="show-tasks-group" class="toggle-filter"> Only failed tasks</label>
     </div>
+  </div>
 
   <div>
     <div class="checkbox-inline log-viewer-button" style="margin-left: 10px">
@@ -123,20 +136,16 @@ $("#sort-by-node").on("change", function() {
     <div class="checkbox-inline log-viewer-button">
       <label><input id="show-crunchstat" type="checkbox" checked="true" class="toggle-filter"> Show compute usage</label>
     </div>
-    <div class="checkbox-inline log-viewer-button">
-      <label><input id="show-successful-tasks" type="checkbox" checked="true" class="toggle-filter"> Show successful tasks</label>
-    </div>
-    <div class="checkbox-inline log-viewer-button">
-      <label><input id="show-failed-tasks" type="checkbox" checked="true" class="toggle-filter"> Show failed tasks</label>
-    </div>
-    </div>
+
+  </div>
 
   <table class="log-viewer-table">
     <thead>
       <tr>
         <th class="id" data-sort="id"></th>
         <th class="timestamp" data-sort="timestamp">Timestamp</th>
-        <th class="node"  data-sort="taskid">Node</th>
+        <th class="node"  data-sort="node">Node</th>
+        <th class="slot"  data-sort="slot">Slot</th>
         <th class="type" data-sort="type">Log type</th>
         <th class="taskid"  data-sort="taskid">Task</th>
         <th class="message" data-sort="message">Message</th>
@@ -147,6 +156,7 @@ $("#sort-by-node").on("change", function() {
         <td class="id"></td>
         <td class="timestamp"></td>
         <td class="node"></td>
+        <td class="slot"></td>
         <td class="type"></td>
         <td class="taskid"></td>
         <td class="message"></td>

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list