[ARVADOS] updated: 37a96c457032ea9660c6342790667dcdb54b9609

git at public.curoverse.com git at public.curoverse.com
Thu Nov 20 12:19:45 EST 2014


Summary of changes:
 apps/workbench/app/assets/javascripts/event_log.js | 22 ++++++++++++----------
 services/api/lib/simulate_job_log.rb               | 15 +++++++++++++--
 2 files changed, 25 insertions(+), 12 deletions(-)

       via  37a96c457032ea9660c6342790667dcdb54b9609 (commit)
       via  5ea9de16b0500d7006ce5c7afd8e0776c4c588ca (commit)
       via  551258ddbe76b3ba8a9e741e42b3ae85914adb86 (commit)
      from  9f1c3e8177ffee8503a885bbb6786e7e42d3e257 (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 37a96c457032ea9660c6342790667dcdb54b9609
Author: Phil Hodgson <bitbucket at philhodgson.net>
Date:   Thu Nov 20 18:19:39 2014 +0100

    4233: make the log replay helper deal with the old date format

diff --git a/services/api/lib/simulate_job_log.rb b/services/api/lib/simulate_job_log.rb
index a0ab28d..71c9825 100644
--- a/services/api/lib/simulate_job_log.rb
+++ b/services/api/lib/simulate_job_log.rb
@@ -11,8 +11,19 @@ module SimulateJobLog
 		act_as_system_user do
 			File.open(filename).each.with_index do |line, index|
 				cols = {}
-		        cols[:timestamp], cols[:job_uuid], cols[:pid], cols[:task], cols[:event_type], cols[:message] = line.split(' ', 6)
-		        cols[:timestamp] = Time.strptime( cols[:timestamp], "%Y-%m-%d_%H:%M:%S" )
+		        cols[:timestamp], rest_of_line = line.split(' ', 2)
+		        begin
+		        	cols[:timestamp] = Time.strptime( cols[:timestamp], "%Y-%m-%d_%H:%M:%S" )
+		        rescue ArgumentError
+		        	if line =~ /^((?:Sun|Mon|Tue|Wed|Thu|Fri|Sat) (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{1,2} \d\d:\d\d:\d\d \d{4}) (.*)/
+			        	# Wed Nov 19 07:12:39 2014
+			        	cols[:timestamp] = Time.strptime( $1, "%a %b %d %H:%M:%S %Y" )
+			        	rest_of_line = $2
+			        else
+				        STDERR.puts "Ignoring log line because of unknown time format: #{line}"
+			        end
+		        end
+	        	cols[:job_uuid], cols[:pid], cols[:task], cols[:event_type], cols[:message] = rest_of_line.split(' ', 5)
 		        # Override job uuid with a simulated one if specified
 		        cols[:job_uuid] = simulated_job_uuid || cols[:job_uuid]
 		        # determine when we want to simulate this log being created, based on the time multiplier

commit 5ea9de16b0500d7006ce5c7afd8e0776c4c588ca
Author: Phil Hodgson <bitbucket at philhodgson.net>
Date:   Thu Nov 20 18:17:53 2014 +0100

    4233: in hover popup only show datapoints that are defined

diff --git a/apps/workbench/app/assets/javascripts/event_log.js b/apps/workbench/app/assets/javascripts/event_log.js
index 7892454..bc54024 100644
--- a/apps/workbench/app/assets/javascripts/event_log.js
+++ b/apps/workbench/app/assets/javascripts/event_log.js
@@ -254,12 +254,13 @@ function createJobGraph(elementName) {
                 var sortedIndex = jobGraphSortedSeries[i];
                 var series = options.ykeys[sortedIndex];
                 var datum = options.data[index][series];
-                s += "<div class='morris-hover-point' style='color: ";
-                s += options.lineColors[sortedIndex];
-                s += "'>";
+                var point = ''
+                point += "<div class='morris-hover-point' style='color: ";
+                point += options.lineColors[sortedIndex];
+                point += "'>";
                 var labelMatch = options.labels[sortedIndex].match(/^T(\d+)-(.*)/);
-                s += 'Task ' + labelMatch[1] + ' ' + labelMatch[2];
-                s += ": ";
+                point += 'Task ' + labelMatch[1] + ' ' + labelMatch[2];
+                point += ": ";
                 if ( datum !== undefined ) {
                     if( isJobSeriesRescalable( series ) ) {
                         datum *= jobGraphMaxima[series];
@@ -274,11 +275,12 @@ function createJobGraph(elementName) {
                         }
                         datum += ' (' + options.data[index]['raw-'+series] + ')';
                     }
-                    s += datum;
+                    point += datum;
                 } else {
-                    s += '-';
+                    continue;
                 }
-                s += "</div> ";
+                point += "</div> ";
+                s += point;
             }
             return s;
         }

commit 551258ddbe76b3ba8a9e741e42b3ae85914adb86
Author: Phil Hodgson <bitbucket at philhodgson.net>
Date:   Thu Nov 20 18:17:24 2014 +0100

    4233: bug fix: match log line regex from beginning of line

diff --git a/apps/workbench/app/assets/javascripts/event_log.js b/apps/workbench/app/assets/javascripts/event_log.js
index 22bcc9d..7892454 100644
--- a/apps/workbench/app/assets/javascripts/event_log.js
+++ b/apps/workbench/app/assets/javascripts/event_log.js
@@ -65,9 +65,9 @@ $(document).on('ajax:complete ready', function() {
  */
 function processLogLineForChart( logLine ) {
     try {
-        var match = logLine.match(/(\S+) (\S+) (\S+) (\S+) stderr crunchstat: (\S+) (.*)/);
+        var match = logLine.match(/^(\S+) (\S+) (\S+) (\S+) stderr crunchstat: (\S+) (.*)/);
         if( !match ) {
-            match = logLine.match(/((?:Sun|Mon|Tue|Wed|Thu|Fri|Sat) (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{1,2} \d\d:\d\d:\d\d \d{4}) (\S+) (\S+) (\S+) stderr crunchstat: (\S+) (.*) -- interval (.*)/);
+            match = logLine.match(/^((?:Sun|Mon|Tue|Wed|Thu|Fri|Sat) (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{1,2} \d\d:\d\d:\d\d \d{4}) (\S+) (\S+) (\S+) stderr crunchstat: (\S+) (.*)/);
             if( match ) {
                 match[1] = (new Date(match[1] + ' UTC')).toISOString().replace('Z','');
             }

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list