[Swift-commit] r3391 - branches/woz-01/libexec/log-processing

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Thu Jun 17 16:15:57 CDT 2010


Author: wozniak
Date: 2010-06-17 16:15:57 -0500 (Thu, 17 Jun 2010)
New Revision: 3391

Added:
   branches/woz-01/libexec/log-processing/extract-coaster-blocks
Log:
Missing file


Added: branches/woz-01/libexec/log-processing/extract-coaster-blocks
===================================================================
--- branches/woz-01/libexec/log-processing/extract-coaster-blocks	                        (rev 0)
+++ branches/woz-01/libexec/log-processing/extract-coaster-blocks	2010-06-17 21:15:57 UTC (rev 3391)
@@ -0,0 +1,27 @@
+
+set -x
+
+COASTERS_TMP=$1
+
+IFS=$'\n'
+REQUESTED=0
+RUNNING=0
+for LINE in $(cat ${COASTERS_TMP} ); do
+	TIME=`echo $LINE | sed 's/^\([^ ]*\) .*$/\1/' `
+	ID=`echo $LINE | sed 's/^.*id=\([^ ]*\)\(,.*$\|$\)/\1/'`
+	ADD=`echo $LINE | sed -n 's/^.*BLOCK_REQUESTED.*w=\([^ ]*\),.*$/\1/p'`
+	if [ "$ADD" != "" ]; then
+		REQUESTED=$(($REQUESTED + $ADD))
+		echo "$ID,$ADD" >> block-count-table.tmp
+	else
+		COUNT=`cat block-count-table.tmp | grep "$ID" | cut -d , -f 2`
+		if echo $LINE | grep "BLOCK_ACTIVE" >/dev/null; then
+			RUNNING=$(($RUNNING + $COUNT))
+		fi
+		if echo $LINE | grep "BLOCK_SHUTDOWN" >/dev/null; then
+			RUNNING=$(($RUNNING - $COUNT))
+			REQUESTED=$(($REQUESTED - $COUNT))
+		fi
+	fi
+	echo $TIME $REQUESTED $RUNNING >> coaster-blocks.data
+done


Property changes on: branches/woz-01/libexec/log-processing/extract-coaster-blocks
___________________________________________________________________
Name: svn:executable
   + *




More information about the Swift-commit mailing list