1 get_tput_results() {
 2   local tput_file=$1
 3   if [ ! -f ${tput_file} ]; then
 4     error "jmeter throughput file ${tput_file} not found."
 5     exit 1
 6   fi
 7   workdir=`mktemp -d`
 8   awk '/summary \+/' ${tput_file} > ${workdir}/tputlines
 9   awk '{ print $5 }' ${workdir}/tputlines > ${workdir}/time
10   awk -F ":" 'BEGIN { total=0 } { total += $3; print total }' ${workdir}/time > ${workdir}/time.tmp
11   awk '{ print $7 }' ${workdir}/tputlines | cut -d '/' -f 1 > ${workdir}/rampup
12 
13   echo "time,tput" > ${tput_file}.rampup.csv
14   paste -d "," ${workdir}/time.tmp ${workdir}/rampup >> ${tput_file}.rampup.csv
15   rm -fr ${workdir}
16 }
17 
18 for file in `ls tput-*.log`; do
19   get_tput_results ${file}
20 done
21 
22