[ARVADOS] updated: 6b49793347e98146ec96373a6b48f56fac46b881
git at public.curoverse.com
git at public.curoverse.com
Sat Nov 22 06:52:21 EST 2014
Summary of changes:
apps/workbench/app/assets/javascripts/event_log.js | 52 +++++++++++++++-------
apps/workbench/app/controllers/jobs_controller.rb | 4 +-
apps/workbench/app/views/jobs/_show_log.html.erb | 13 +-----
apps/workbench/app/views/jobs/push_logs.js.erb | 8 +++-
4 files changed, 45 insertions(+), 32 deletions(-)
via 6b49793347e98146ec96373a6b48f56fac46b881 (commit)
via 5ac72e336a49d5a07e9ee36ba1f50473c57c45ec (commit)
via caaa4ae5c95c0f4b7a62702a4371bc9838661e72 (commit)
via eb26344db7daf2a595fa98fc72aee00b88e1633f (commit)
from 37a96c457032ea9660c6342790667dcdb54b9609 (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 6b49793347e98146ec96373a6b48f56fac46b881
Author: Phil Hodgson <bitbucket at philhodgson.net>
Date: Sat Nov 22 12:52:16 2014 +0100
4233: ignore negative deltas when charting log stats
diff --git a/apps/workbench/app/assets/javascripts/event_log.js b/apps/workbench/app/assets/javascripts/event_log.js
index 31c30c8..bd5e78c 100644
--- a/apps/workbench/app/assets/javascripts/event_log.js
+++ b/apps/workbench/app/assets/javascripts/event_log.js
@@ -89,6 +89,12 @@ function processLogLineForChart( logLine ) {
dsum += parseFloat(intervalData[i]);
}
datum = dsum/dt;
+
+ if( datum < 0 ) {
+ // not interested in negative deltas
+ return;
+ }
+
rawDetailData = intervalMatch[2];
// for the series name use the task number (4th term) and then the first word after 'crunchstat:'
commit 5ac72e336a49d5a07e9ee36ba1f50473c57c45ec
Author: Phil Hodgson <bitbucket at philhodgson.net>
Date: Sat Nov 22 12:30:10 2014 +0100
4233: refactor to only query the log lines once and use the JS triggers to create both the text log div and the stat chart at the same time
diff --git a/apps/workbench/app/assets/javascripts/event_log.js b/apps/workbench/app/assets/javascripts/event_log.js
index 1b8480e..31c30c8 100644
--- a/apps/workbench/app/assets/javascripts/event_log.js
+++ b/apps/workbench/app/assets/javascripts/event_log.js
@@ -320,19 +320,31 @@ $(document).on('arv-log-event', '#log_graph_div', function(event, eventData) {
}
} );
-$(document).on('ready', function(){
- window.recreate = false;
- window.redraw = false;
- setInterval( function() {
- if( recreate ) {
- window.recreate = false;
- window.redraw = false;
- // series have changed, draw entirely new graph
- $('#log_graph_div').html('');
- createJobGraph('log_graph_div');
- } else if( redraw ) {
- window.redraw = false;
- jobGraph.setData( jobGraphData );
- }
- }, 5000);
+$(document).on('ready ajax:complete', function() {
+ $('#log_graph_div').not('.graph-is-setup').addClass('graph-is-setup').each( function( index, graph_div ) {
+ window.jobGraphData = [];
+ window.jobGraphSeries = [];
+ window.jobGraphSortedSeries = [];
+ window.jobGraphMaxima = {};
+ window.recreate = false;
+ window.redraw = false;
+
+ createJobGraph($(graph_div).attr('id'));
+
+ $(document).trigger('ajax:send');
+ $.get('/jobs/' + $(graph_div).data('object-uuid') + '/push_logs.js');
+
+ setInterval( function() {
+ if( recreate ) {
+ window.recreate = false;
+ window.redraw = false;
+ // series have changed, draw entirely new graph
+ $(graph_div).html('');
+ createJobGraph($(graph_div).attr('id'));
+ } else if( redraw ) {
+ window.redraw = false;
+ jobGraph.setData( jobGraphData );
+ }
+ }, 5000);
+ });
});
diff --git a/apps/workbench/app/controllers/jobs_controller.rb b/apps/workbench/app/controllers/jobs_controller.rb
index 11a4e99..e6d0ccd 100644
--- a/apps/workbench/app/controllers/jobs_controller.rb
+++ b/apps/workbench/app/controllers/jobs_controller.rb
@@ -58,9 +58,7 @@ class JobsController < ApplicationController
end
def push_logs
- @push_logs = stderr_log_records([@object.uuid]).select do |log_record|
- log_record.properties[:text] =~ /crunchstat: (mem.*swap.*rss|.*-- interval)/
- end
+ @push_logs = stderr_log_records([@object.uuid])
end
def index_pane_list
diff --git a/apps/workbench/app/views/jobs/_show_log.html.erb b/apps/workbench/app/views/jobs/_show_log.html.erb
index 64cd96a..9956913 100644
--- a/apps/workbench/app/views/jobs/_show_log.html.erb
+++ b/apps/workbench/app/views/jobs/_show_log.html.erb
@@ -4,12 +4,10 @@
class="arv-log-event-listener"
data-object-uuid="<%= @object.uuid %>"></div>
-<% log_history = stderr_log_history([@object.uuid]) %>
-
<div id="event_log_div"
class="arv-log-event-listener arv-log-event-handler-append-logs arv-job-log-window"
data-object-uuid="<%= @object.uuid %>"
- ><%= log_history.join("\n") %></div>
+ ></div>
<%# Applying a long throttle suppresses the auto-refresh of this
partial that would normally be triggered by arv-log-event. %>
@@ -17,15 +15,6 @@
data-load-throttle="86486400000" <%# 1001 nights %>
></div>
-<%= javascript_tag do %>
- window.jobGraphData = [];
- window.jobGraphSeries = [];
- window.jobGraphSortedSeries = [];
- window.jobGraphMaxima = {};
- $.get('<%= push_logs_job_path(@object) %>');
- createJobGraph('log_graph_div');
-<% end %>
-
<% else %>
<script>
diff --git a/apps/workbench/app/views/jobs/push_logs.js.erb b/apps/workbench/app/views/jobs/push_logs.js.erb
index 2eac3b4..a811ed6 100644
--- a/apps/workbench/app/views/jobs/push_logs.js.erb
+++ b/apps/workbench/app/views/jobs/push_logs.js.erb
@@ -1,3 +1,9 @@
+var object_uuid = '<%= @object.uuid %>';
+// if there are any listeners for this object uuid or "all", we will trigger the event
+var matches = ".arv-log-event-listener[data-object-uuid=\"" + object_uuid + "\"],.arv-log-event-listener[data-object-uuids~=\"" + object_uuid + "\"],.arv-log-event-listener[data-object-uuid=\"all\"],.arv-log-event-listener[data-object-kind=\"" + parsedData.object_kind + "\"]";
<% @push_logs.each do |log_record| %>
- processLogLineForChart( '<%=j log_record.properties[:text] %>' );
+ var parsedData = { object_uuid: '<%=j log_record.object_uuid %>',
+ event_type: '<%=j log_record.event_type %>',
+ properties: { text: '<%=j log_record.properties[:text] %>' } };
+ $(matches).trigger('arv-log-event', parsedData);
<% end %>
\ No newline at end of file
commit caaa4ae5c95c0f4b7a62702a4371bc9838661e72
Author: Phil Hodgson <bitbucket at philhodgson.net>
Date: Sat Nov 22 11:50:22 2014 +0100
4233: do not show "raw" data for datapoint if not defined
diff --git a/apps/workbench/app/assets/javascripts/event_log.js b/apps/workbench/app/assets/javascripts/event_log.js
index bc54024..1b8480e 100644
--- a/apps/workbench/app/assets/javascripts/event_log.js
+++ b/apps/workbench/app/assets/javascripts/event_log.js
@@ -273,7 +273,9 @@ function createJobGraph(elementName) {
} else {
datum = $.number(datum);
}
- datum += ' (' + options.data[index]['raw-'+series] + ')';
+ if(options.data[index]['raw-'+series]) {
+ datum += ' (' + options.data[index]['raw-'+series] + ')';
+ }
}
point += datum;
} else {
commit eb26344db7daf2a595fa98fc72aee00b88e1633f
Author: Phil Hodgson <bitbucket at philhodgson.net>
Date: Sat Nov 22 10:43:58 2014 +0100
4233: tab character corrected
diff --git a/apps/workbench/app/views/jobs/push_logs.js.erb b/apps/workbench/app/views/jobs/push_logs.js.erb
index 40ce037..2eac3b4 100644
--- a/apps/workbench/app/views/jobs/push_logs.js.erb
+++ b/apps/workbench/app/views/jobs/push_logs.js.erb
@@ -1,3 +1,3 @@
<% @push_logs.each do |log_record| %>
- processLogLineForChart( '<%=j log_record.properties[:text] %>' );
+ processLogLineForChart( '<%=j log_record.properties[:text] %>' );
<% end %>
\ No newline at end of file
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list