Skip to content

Instantly share code, notes, and snippets.

@tenforward
Created October 14, 2011 05:27
Show Gist options
  • Select an option

  • Save tenforward/1286317 to your computer and use it in GitHub Desktop.

Select an option

Save tenforward/1286317 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# Summarize script from results output for Dell DVD Store
for d in `find . -mindepth 1 -type d`
do
touch $d/summary.txt
echo "clients order/sec cpu usage response time" >> $d/summary.txt
for f in `ls $d/results*.txt | sort -g`
do
db=`grep Final $f`
cpu=`grep ^host $f | tail -n 1`
client=`echo $f | sed -e 's/results//' -e 's/\.txt//' -e "s|$d/||"`
tmp=${db#*opm=}
opm=${tmp%% *}
cpuusage=${cpu#*CPU%=}
tmp=${db#*rt_tot_avg=}
rt_tot_avg=${tmp%% *}
echo "$client $opm $rt_tot_avg $cpuusage" >> $d/summary.txt
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment