[Swift-commit] r4409 - trunk/libexec/log-processing
wozniak at ci.uchicago.edu
wozniak at ci.uchicago.edu
Mon Apr 25 14:37:57 CDT 2011
Author: wozniak
Date: 2011-04-25 14:37:56 -0500 (Mon, 25 Apr 2011)
New Revision: 4409
Added:
trunk/libexec/log-processing/extract-times.pl
Log:
Adding
Added: trunk/libexec/log-processing/extract-times.pl
===================================================================
--- trunk/libexec/log-processing/extract-times.pl (rev 0)
+++ trunk/libexec/log-processing/extract-times.pl 2011-04-25 19:37:56 UTC (rev 4409)
@@ -0,0 +1,40 @@
+#!/usr/bin/perl -n
+
+# Extract job runtimes for each job from Coasters
+# Cpu log lines
+
+# usage: extract-times.pl < <LOGFILE>
+
+# Requires numerical timestamps (cf. iso-to-secs)
+# Uses the Cpu id to determine Cpu start and stop times
+# Assumes all jobs are the same
+# Output is simple column of runtimes
+
+BEGIN
+{
+ %cpus = ();
+}
+
+if (/Cpu/)
+{
+ if (/submitting/)
+ {
+ /(\d*\.\d*) .* Cpu (.*) submitting/;
+ my $time = $1;
+ my $cpu = $2;
+ $cpus{$cpu} = $time;
+ }
+ if (/jobTerminated/)
+ {
+ /(\d*\.\d*) .* Cpu (.*) jobTerminated/;
+ my $time = $1;
+ my $cpu = $2;
+ my $start = $cpus{$cpu};
+ my $duration = $time - $start;
+ printf("%.3f\n", $duration);
+ }
+}
+
+# Local Variables:
+# perl-basic-offset: 2
+# End:
Property changes on: trunk/libexec/log-processing/extract-times.pl
___________________________________________________________________
Name: svn:executable
+ *
More information about the Swift-commit
mailing list