[Swift-commit] r4320 - trunk/libexec/log-processing
wozniak at ci.uchicago.edu
wozniak at ci.uchicago.edu
Fri Apr 8 14:37:38 CDT 2011
Author: wozniak
Date: 2011-04-08 14:37:38 -0500 (Fri, 08 Apr 2011)
New Revision: 4320
Added:
trunk/libexec/log-processing/cpu-jobs-complete.pl
Log:
Copy to start on jobs complete plot
Copied: trunk/libexec/log-processing/cpu-jobs-complete.pl (from rev 4319, trunk/libexec/log-processing/cpu-job-load.pl)
===================================================================
--- trunk/libexec/log-processing/cpu-jobs-complete.pl (rev 0)
+++ trunk/libexec/log-processing/cpu-jobs-complete.pl 2011-04-08 19:37:38 UTC (rev 4320)
@@ -0,0 +1,30 @@
+#!/usr/bin/perl
+
+# Accumulate the load level at each point in time
+# INPUT: A Swift log file with Coasters messages:
+# timestamp ... Cpu ... submitting ...
+# timestamp ... Cpu ... jobTerminated ...
+# where timestamp is a number
+# OUTPUT: lines formatted as "timestamp load"
+# where timestamp and load are numbers
+
+$time = 0.0;
+$load = 0;
+
+sub report() {
+ @tokens = split;
+ printf("$tokens[0] $load\n");
+}
+
+while (<STDIN>) {
+ if (/Cpu/) {
+ if (/submitting/) {
+ $load++;
+ report;
+ }
+ elsif (/jobTerminated/) {
+ $load--;
+ report;
+ }
+ }
+}
More information about the Swift-commit
mailing list