[ARVADOS] updated: 7139cabb0d75c946b53c128676d0597881ae2700
git at public.curoverse.com
git at public.curoverse.com
Sun Nov 16 11:48:16 EST 2014
Summary of changes:
apps/workbench/app/assets/javascripts/event_log.js | 28 ++++++++++++----------
apps/workbench/app/views/jobs/_show_log.html.erb | 3 +--
2 files changed, 17 insertions(+), 14 deletions(-)
via 7139cabb0d75c946b53c128676d0597881ae2700 (commit)
via ec988adb09485a9d2c9c0315300b0ad52afc07ef (commit)
from e9ccda58ac1b7334cfeee8ab23dd37d9bf3f534d (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 7139cabb0d75c946b53c128676d0597881ae2700
Author: Phil Hodgson <bitbucket at philhodgson.net>
Date: Sun Nov 16 17:48:11 2014 +0100
4233: chart stats for parallel tasks separately
- this commit also extends the scroll time to 10 minutes
diff --git a/apps/workbench/app/assets/javascripts/event_log.js b/apps/workbench/app/assets/javascripts/event_log.js
index 3b5358e..1a082a0 100644
--- a/apps/workbench/app/assets/javascripts/event_log.js
+++ b/apps/workbench/app/assets/javascripts/event_log.js
@@ -66,15 +66,20 @@ function processLogLineForChart( logLine ) {
var recreate = false;
var rescale = false;
// TODO: make this more robust: anything could go wrong in here
- var match = logLine.match(/(.*)crunchstat:(.*)-- interval(.*)/);
+ var match = logLine.match(/(\S+) (\S+) (\S+) (\S+) stderr crunchstat: (\S+) (.*) -- interval (.*)/);
if( match ) {
- var series = match[2].trim().split(' ')[0];
+ // the timestamp comes first
+ var timestamp = match[1].replace('_','T');
+ // for the series use the first word after 'crunchstat:'
+ var series = match[5];
+ // and append the task number (the 4th term)
+ series += '-' + match[4]
if( $.inArray( series, jobGraphSeries) < 0 ) {
jobGraphSeries.push(series);
jobGraphMaxima[series] = null;
recreate = true;
}
- var intervalData = match[3].trim().split(' ');
+ var intervalData = match[7].trim().split(' ');
var dt = parseFloat(intervalData[0]);
var dsum = 0.0;
for(var i=2; i < intervalData.length; i += 2 ) {
@@ -90,8 +95,9 @@ function processLogLineForChart( logLine ) {
rescaleJobGraphSeries( series, scaleConversion );
}
// and special calculation for cpus
- if( series === 'cpu' ) {
- var cpuCountMatch = match[2].match(/(\d+) cpus/);
+ if( /^cpu-/.test(series) ) {
+ // divide the stat by the number of cpus
+ var cpuCountMatch = match[6].match(/(\d+) cpus/);
if( cpuCountMatch ) {
datum = datum / cpuCountMatch[1];
}
@@ -105,9 +111,6 @@ function processLogLineForChart( logLine ) {
} else {
scaledDatum = datum;
}
- // more parsing
- var preamble = match[1].trim().split(' ');
- var timestamp = preamble[0].replace('_','T');
// identify x axis point
var found = false;
for( var i = jobGraphData.length - 1; i >= 0; i-- ) {
@@ -128,9 +131,9 @@ function processLogLineForChart( logLine ) {
entry[series] = scaledDatum;
jobGraphData.splice( insertAt, 0, entry );
var shifted = [];
- // now let's see about "scrolling" the graph, dropping entries that are too old (>3 minutes)
+ // now let's see about "scrolling" the graph, dropping entries that are too old (>10 minutes)
while( jobGraphData.length > 0
- && (Date.parse( jobGraphData[0]['t'] ).valueOf() + 3*60000 < Date.parse( jobGraphData[jobGraphData.length-1]['t'] ).valueOf()) ) {
+ && (Date.parse( jobGraphData[0]['t'] ).valueOf() + 10*60000 < Date.parse( jobGraphData[jobGraphData.length-1]['t'] ).valueOf()) ) {
shifted.push(jobGraphData.shift());
}
if( shifted.length > 0 ) {
diff --git a/apps/workbench/app/views/jobs/_show_log.html.erb b/apps/workbench/app/views/jobs/_show_log.html.erb
index d3c0a18..c4100a3 100644
--- a/apps/workbench/app/views/jobs/_show_log.html.erb
+++ b/apps/workbench/app/views/jobs/_show_log.html.erb
@@ -23,8 +23,7 @@
window.jobGraphMaxima = {};
<% stderr_log_records([@object.uuid],[['properties','~','crunchstat:.*-- interval']])
.each.with_index do |log_record, index| %>
- var logLine = '<%=j log_record.properties[:text] %>';
- processLogLineForChart( logLine );
+ processLogLineForChart( '<%=j log_record.properties[:text] %>' );
<% end %>
window.jobGraph = Morris.Line({
element: 'log_graph_div',
commit ec988adb09485a9d2c9c0315300b0ad52afc07ef
Author: Phil Hodgson <bitbucket at philhodgson.net>
Date: Sun Nov 16 15:42:30 2014 +0100
4233: bug fix - rounding errors were causing us to miss maxima scrolling off the chart, and rescaling was not occurring
diff --git a/apps/workbench/app/assets/javascripts/event_log.js b/apps/workbench/app/assets/javascripts/event_log.js
index 27a88fe..3b5358e 100644
--- a/apps/workbench/app/assets/javascripts/event_log.js
+++ b/apps/workbench/app/assets/javascripts/event_log.js
@@ -137,10 +137,11 @@ function processLogLineForChart( logLine ) {
// from those that we dropped, are any of them maxima? if so we need to rescale
jobGraphSeries.forEach( function(series) {
// test that every shifted entry in this series was either not a number (in which case we don't care)
- // or else smaller than the scaled maximum (i.e. 1), because otherwise we just scrolled off something that was a maximum point
+ // or else approximately (to 2 decimal places) smaller than the scaled maximum (i.e. 1),
+ // because otherwise we just scrolled off something that was a maximum point
// and so we need to recalculate a new maximum point by looking at all remaining displayed points in the series
if( isJobSeriesRescalable(series) && jobGraphMaxima[series] !== null
- && !shifted.every( function(e) { return( !($.isNumeric(e[series])) || e[series] < 1 ) } ) ) {
+ && !shifted.every( function(e) { return( !$.isNumeric(e[series]) || e[series].toFixed(2) < 1.0 ) } ) ) {
// check the remaining displayed points and find the new (scaled) maximum
var seriesMax = null;
jobGraphData.forEach( function(entry) {
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list