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

wozniak at ci.uchicago.edu wozniak at ci.uchicago.edu
Tue Apr 26 15:48:26 CDT 2011


Author: wozniak
Date: 2011-04-26 15:48:26 -0500 (Tue, 26 Apr 2011)
New Revision: 4422

Added:
   trunk/libexec/log-processing/normalize-log.pl
Log:
Adding

Added: trunk/libexec/log-processing/normalize-log.pl
===================================================================
--- trunk/libexec/log-processing/normalize-log.pl	                        (rev 0)
+++ trunk/libexec/log-processing/normalize-log.pl	2011-04-26 20:48:26 UTC (rev 4422)
@@ -0,0 +1,26 @@
+#!/usr/bin/perl
+
+# INPUT: two files: the first contains the start time
+# and the second contains the log file with unix timestamps
+
+# OUTPUT: stdout: the log file with timestamps normalized
+# to the start time
+
+$TIME = $ARGV[0];
+$LOG  = $ARGV[1];
+
+my $earliesttime;
+
+open(START, $TIME) || die "$!\n";
+read(FH, $earliesttime, 64);
+close START;
+
+open(LOG, $LOG) || die "$!\n";
+
+foreach $n (<LOG>) {
+  $n =~ /^([^ ]*) (.*)$/ ;
+  $delta = $1 - $earliesttime;
+  print "$delta $2\n";
+}
+
+close LOG;


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




More information about the Swift-commit mailing list