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

wozniak at ci.uchicago.edu wozniak at ci.uchicago.edu
Wed Apr 6 15:40:00 CDT 2011


Author: wozniak
Date: 2011-04-06 15:40:00 -0500 (Wed, 06 Apr 2011)
New Revision: 4293

Added:
   trunk/libexec/log-processing/accumulate-load.pl
Log:
Script to build up a load level


Added: trunk/libexec/log-processing/accumulate-load.pl
===================================================================
--- trunk/libexec/log-processing/accumulate-load.pl	                        (rev 0)
+++ trunk/libexec/log-processing/accumulate-load.pl	2011-04-06 20:40:00 UTC (rev 4293)
@@ -0,0 +1,23 @@
+#!/usr/bin/perl
+
+# Accumulate the load level at each point in time
+# INPUT:  lines formatted as "timestamp text"
+#         where timestamp is a number
+# OUTPUT: lines formatted as "timestamp load"
+#         where timestamp and load are numbers
+
+$time = 0.0;
+$load = 0;
+
+foreach $n (<STDIN>) {
+  $n =~ /^([^ ]*) (.*)$/ ;
+  $time = $1;
+  $info = $2;
+  if ($info =~ /START/) {
+      $load++;
+  }
+  elsif ($info =~ /END/) {
+      $load--;
+  }
+  printf("%.4f %i\n", $time, $load);
+}


Property changes on: trunk/libexec/log-processing/accumulate-load.pl
___________________________________________________________________
Name: svn:executable
   + *




More information about the Swift-commit mailing list