[ARVADOS] updated: 73a8436194e335cfa3e208b2cc86350a2c35ae57
git at public.curoverse.com
git at public.curoverse.com
Sun Nov 16 14:20:01 EST 2014
Summary of changes:
apps/workbench/app/assets/javascripts/event_log.js | 46 +++++++++++++++++-----
apps/workbench/app/views/jobs/_show_log.html.erb | 9 +----
2 files changed, 38 insertions(+), 17 deletions(-)
via 73a8436194e335cfa3e208b2cc86350a2c35ae57 (commit)
from 7139cabb0d75c946b53c128676d0597881ae2700 (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 73a8436194e335cfa3e208b2cc86350a2c35ae57
Author: Phil Hodgson <bitbucket at philhodgson.net>
Date: Sun Nov 16 20:19:54 2014 +0100
4233: show original data in hover info instead of proportions
diff --git a/apps/workbench/app/assets/javascripts/event_log.js b/apps/workbench/app/assets/javascripts/event_log.js
index 1a082a0..a763d32 100644
--- a/apps/workbench/app/assets/javascripts/event_log.js
+++ b/apps/workbench/app/assets/javascripts/event_log.js
@@ -170,6 +170,41 @@ function processLogLineForChart( logLine ) {
return recreate;
}
+function createJobGraph(elementName) {
+ delete jobGraph;
+ window.jobGraph = Morris.Line( {
+ element: elementName,
+ data: jobGraphData,
+ ymax: 1.0,
+ xkey: 't',
+ ykeys: jobGraphSeries,
+ labels: jobGraphSeries,
+ hideHover: 'auto',
+ hoverCallback: function(index, options, content) {
+ var s = "<div class='morris-hover-row-label'>";
+ s += options.data[index][options.xkey];
+ s += "</div> ";
+ for( i = 0; i < options.ykeys.length; i++ ) {
+ var series = options.ykeys[i];
+ var datum = options.data[index][series];
+ s += "<div class='morris-hover-point' style='color: ";
+ s += options.lineColors[i];
+ s += "'>";
+ s += options.labels[i];
+ s += ": ";
+ if ( !(typeof datum === 'undefined') ) {
+ if( isJobSeriesRescalable( series ) ) {
+ datum *= jobGraphMaxima[series];
+ }
+ s += datum.toFixed(2);
+ }
+ s += "</div> ";
+ }
+ return s;
+ }
+ });
+}
+
function rescaleJobGraphSeries( series, scaleConversion ) {
if( isJobSeriesRescalable() ) {
$.each( jobGraphData, function( i, entry ) {
@@ -182,7 +217,7 @@ function rescaleJobGraphSeries( series, scaleConversion ) {
// that's right - we never do this for the 'cpu' series, which will always be between 0 and 1 anyway
function isJobSeriesRescalable( series ) {
- return series != 'cpu';
+ return !/^cpu-/.test(series);
}
$(document).on('arv-log-event', '#log_graph_div', function(event, eventData) {
@@ -204,14 +239,7 @@ $(document).on('ready', function(){
window.recreate = false;
// series have changed, draw entirely new graph
$('#log_graph_div').html('');
- window.jobGraph = Morris.Line({
- element: 'log_graph_div',
- data: jobGraphData,
- ymax: 1.0,
- xkey: 't',
- ykeys: jobGraphSeries,
- labels: jobGraphSeries
- });
+ createJobGraph('log_graph_div');
} else if( redraw ) {
window.redraw = false;
jobGraph.setData( jobGraphData );
diff --git a/apps/workbench/app/views/jobs/_show_log.html.erb b/apps/workbench/app/views/jobs/_show_log.html.erb
index c4100a3..af9ab5d 100644
--- a/apps/workbench/app/views/jobs/_show_log.html.erb
+++ b/apps/workbench/app/views/jobs/_show_log.html.erb
@@ -25,14 +25,7 @@
.each.with_index do |log_record, index| %>
processLogLineForChart( '<%=j log_record.properties[:text] %>' );
<% end %>
- window.jobGraph = Morris.Line({
- element: 'log_graph_div',
- data: jobGraphData,
- ymax: 1.0,
- xkey: 't',
- ykeys: jobGraphSeries,
- labels: jobGraphSeries
- });
+ createJobGraph('log_graph_div');
<% end %>
<% else %>
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list