From: Razvan Deaconescu Date: Sat, 31 Jul 2010 10:11:40 +0000 (+0300) Subject: ControlScripts: fix hrk parse generated output: one-space separator, no measure units... X-Git-Tag: classic-scenario-config~13 X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=commitdiff_plain;h=afd67e13a92205d40f9b7af42637bc0c33fd261c;p=p2p-testing-infrastructure.git ControlScripts: fix hrk parse generated output: one-space separator, no measure units, correct upload and download speed, two decimal digits --- diff --git a/ControlScripts/parse_hrk.sh b/ControlScripts/parse_hrk.sh index 6a448e4..b996e27 100755 --- a/ControlScripts/parse_hrk.sh +++ b/ControlScripts/parse_hrk.sh @@ -43,13 +43,20 @@ echo "time percent upspeed dlspeed" > $DATA_FILE # Clean and parse the log file grep '^ps' $LOG_FOLDER/$LOG_FILE | awk -F '[ \t<>:,]+' ' +BEGIN { + count = 1; +} + { + dlspeed = $6 + 0; + upspeed = $8 + 0; + download = $10 + 0; size = $14 + 0; + percent = 100.0 * download / size; - percent = 100 * download / size; - percent_string = sprintf("%.2f", percent); - print percent, $6, $8; -}' | cat -b >> $DATA_FILE + printf "%d %.2f %.2f %.2f\n", count, percent, upspeed, dlspeed; + count++; +}' >> $DATA_FILE exit 0