[ARVADOS] updated: 02825a88733a13a58775774053fb0945e9adf693

git at public.curoverse.com git at public.curoverse.com
Mon Jun 16 11:46:08 EDT 2014


Summary of changes:
 .../workbench/app/assets/javascripts/log_viewer.js | 39 +++++++++++++++++++---
 .../app/assets/stylesheets/log_viewer.scss         | 11 ++++--
 apps/workbench/app/views/jobs/_show_log.html.erb   | 35 +++++++++++--------
 3 files changed, 65 insertions(+), 20 deletions(-)

       via  02825a88733a13a58775774053fb0945e9adf693 (commit)
       via  d99707463cd5bf757322cde334c32e398abbf6f9 (commit)
      from  b8475bddb17b1c303b527524dd384f1bde514a36 (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 02825a88733a13a58775774053fb0945e9adf693
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Mon Jun 16 15:46:06 2014 +0000

    2883: Fix pattern for discovering success/failure of tasks.

diff --git a/apps/workbench/app/assets/javascripts/log_viewer.js b/apps/workbench/app/assets/javascripts/log_viewer.js
index fc1d934..e8bbac6 100644
--- a/apps/workbench/app/assets/javascripts/log_viewer.js
+++ b/apps/workbench/app/assets/javascripts/log_viewer.js
@@ -27,10 +27,10 @@ function addToLogViewer(logViewer, lines, taskState) {
                         type = "task-output";
                     }
                 } else {
-                    if (/^success in (\d+)/.test(message)) {
+                    if (/^success /.test(message)) {
                         taskState[v11] = "success";
                     }
-                    if (/^failure \([^)]+\) (\d+)/.test(message)) {
+                    else if (/^failure /.test(message)) {
                         taskState[v11] = "failure";
                     }
                     type = "task-dispatch";

commit d99707463cd5bf757322cde334c32e398abbf6f9
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Mon Jun 16 15:43:20 2014 +0000

    2883: Fixes secondary key sort bug.  Adds filtering on successful/failed tasks.

diff --git a/apps/workbench/app/assets/javascripts/log_viewer.js b/apps/workbench/app/assets/javascripts/log_viewer.js
index d6c611b..fc1d934 100644
--- a/apps/workbench/app/assets/javascripts/log_viewer.js
+++ b/apps/workbench/app/assets/javascripts/log_viewer.js
@@ -8,12 +8,14 @@ function addToLogViewer(logViewer, lines, taskState) {
 
             v11 = v[11];
             if (typeof v[11] === 'undefined') {
-                v11 = ' ';
+                v11 = "";
+            } else {
+                v11 = Number(v11);
             }
 
             var message = v[12];
             var type = "";
-            if (v11 != ' ') {
+            if (v11 !== "") {
                 if (/^stderr /.test(message)) {
                     message = message.substr(7);
                     if (/^crunchstat: /.test(message)) {
@@ -25,10 +27,10 @@ function addToLogViewer(logViewer, lines, taskState) {
                         type = "task-output";
                     }
                 } else {
-                    if (/^success in (\d+)/) {
+                    if (/^success in (\d+)/.test(message)) {
                         taskState[v11] = "success";
                     }
-                    if (/^failure \([^)]+\) (\d+)/) {
+                    if (/^failure \([^)]+\) (\d+)/.test(message)) {
                         taskState[v11] = "failure";
                     }
                     type = "task-dispatch";
@@ -56,3 +58,32 @@ function addToLogViewer(logViewer, lines, taskState) {
     }
     logViewer.update();
 }
+
+function sortByTaskThenId(a, b, opt) {
+    a = a.values();
+    b = b.values();
+
+    if (a["taskid"] === "" && b["taskid"] !== "") {
+        return -1;
+    }
+    if (a["taskid"] !== "" && b["taskid"] === "") {
+        return 1;
+    }
+
+    if (a["taskid"] !== "" && b["taskid"] !== "") {
+        if (a["taskid"] > b["taskid"]) {
+            return 1;
+        }
+        if (a["taskid"] < b["taskid"]) {
+            return -1;
+        }
+    }
+
+    if (a["id"] > b["id"]) {
+        return 1;
+    }
+    if (a["id"] < b["id"]) {
+        return -1;
+    }
+    return 0;
+}
diff --git a/apps/workbench/app/assets/stylesheets/log_viewer.scss b/apps/workbench/app/assets/stylesheets/log_viewer.scss
index f88ae3d..600c012 100644
--- a/apps/workbench/app/assets/stylesheets/log_viewer.scss
+++ b/apps/workbench/app/assets/stylesheets/log_viewer.scss
@@ -2,6 +2,7 @@
  width: 100%;
  font-family: "Lucida Console", Monaco, monospace;
  font-size: 11px;
+ table-layout: fixed;
  thead tr {
    th {
      padding-right: 1em;
@@ -10,14 +11,17 @@
      display: none;
    }
    th.timestamp {
-     width: 15em;
+     width: 14em;
    }
    th.type {
-     width: 10em;
+     width: 8em;
    }
    th.taskid {
      width: 3em;
    }
+   th.message {
+     width: auto;
+   }
  }
  tbody tr {
    vertical-align: top;
@@ -30,5 +34,8 @@
    td.taskid {
      text-align: right;
    }
+   td.message {
+     word-wrap: break-word;
+   }
  }
 }
\ No newline at end of file
diff --git a/apps/workbench/app/views/jobs/_show_log.html.erb b/apps/workbench/app/views/jobs/_show_log.html.erb
index cead801..41cd08f 100644
--- a/apps/workbench/app/views/jobs/_show_log.html.erb
+++ b/apps/workbench/app/views/jobs/_show_log.html.erb
@@ -5,6 +5,8 @@ var logViewer = new List('log-viewer', {
   page: 10000,
 });
 
+var taskState = {};
+
 var makeFilter = function() {
   var pass = [];
   $(".toggle-filter").each(function(i, e) {
@@ -12,9 +14,19 @@ var makeFilter = function() {
       pass.push(e.id.substr(5));
     }
   });
+
   return (function(item) {
+    var v = false;
+    if (item.values().taskid !== "") {
+      for (a in pass) {
+        if (pass[a] == "successful-tasks" && taskState[item.values().taskid] == "success") { v = true; }
+        if (pass[a] == "failed-tasks" && taskState[item.values().taskid] == "failure") { v = true; }
+      }
+    } else {
+      v = true;
+    }
     for (a in pass) {
-      if (pass[a] == item.values().type) { return true; }
+      if (pass[a] == item.values().type) { return v; }
     }
     return false;
   });
@@ -26,7 +38,7 @@ var makeFilter = function() {
 $.ajax('<%=j url_for logcollection %>/<%=j logcollection.files[0][1] %>').
   done(function(data, status, jqxhr) {
     logViewer.filter();
-    addToLogViewer(logViewer, data.split("\n"));
+    addToLogViewer(logViewer, data.split("\n"), taskState);
     logViewer.filter(makeFilter());
     $("#logloadspinner").detach();
   });
@@ -53,7 +65,7 @@ $("#sort-by-time").on("change", function() {
 });
 
 $("#sort-by-task").on("change", function() {
-  logViewer.sort("taskid");
+  logViewer.sort("taskid", {sortFunction: sortByTaskThenId});
 });
 
 })();
@@ -69,17 +81,6 @@ $("#sort-by-task").on("change", function() {
       <label><input id="sort-by-task" type="radio" name="sort-radio" > Sort by task</label>
     </div>
 
-<br>
-    <div class="radio-inline">
-      <label><input id="filter-tasks-all" type="radio" name="tasks-radio" checked> Show all tasks</label>
-    </div>
-    <div class="radio-inline">
-      <label><input id="filter-tasks-successes" type="radio" name="tasks-radio" > Show successes only</label>
-    </div>
-    <div class="radio-inline">
-      <label><input id="filter-tasks-failures" type="radio" name="tasks-radio" > Show failures only</label>
-    </div>
-<br>
   <div class="checkbox-inline">
     <label><input id="show-crunch" type="checkbox" checked="true" class="toggle-filter"> Show crunch output</label>
   </div>
@@ -95,6 +96,12 @@ $("#sort-by-task").on("change", function() {
   <div class="checkbox-inline">
     <label><input id="show-crunchstat" type="checkbox" checked="true" class="toggle-filter"> Show compute usage</label>
   </div>
+  <div class="checkbox-inline">
+    <label><input id="show-successful-tasks" type="checkbox" checked="true" class="toggle-filter"> Show successful tasks</label>
+  </div>
+  <div class="checkbox-inline">
+    <label><input id="show-failed-tasks" type="checkbox" checked="true" class="toggle-filter"> Show failed tasks</label>
+  </div>
 
 <div class="pull-right">
     <button id="filter-all" class="btn">

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list