[Swift-commit] r4317 - trunk/libexec/log-processing

wozniak at ci.uchicago.edu wozniak at ci.uchicago.edu
Fri Apr 8 14:07:51 CDT 2011


Author: wozniak
Date: 2011-04-08 14:07:51 -0500 (Fri, 08 Apr 2011)
New Revision: 4317

Added:
   trunk/libexec/log-processing/cpu-job-events.pl
Log:
New Coasters plot data extractor for job submission/termination


Added: trunk/libexec/log-processing/cpu-job-events.pl
===================================================================
--- trunk/libexec/log-processing/cpu-job-events.pl	                        (rev 0)
+++ trunk/libexec/log-processing/cpu-job-events.pl	2011-04-08 19:07:51 UTC (rev 4317)
@@ -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;
+	}
+    }
+}


Property changes on: trunk/libexec/log-processing/cpu-job-events.pl
___________________________________________________________________
Name: svn:executable
   + *




More information about the Swift-commit mailing list