#!/bin/bash

for kind in "" .p20 .p80 .shuf .shufp20 .shufp80 ; do 
  echo "$kind ---"
  for scale in 100 400 4000 ; do 
    echo "  $scale ---"
    for run in 1 2 3 4 5 ; do 
      echo -n "    $run: "
      egrep '^CPU:' vacuum_bench_s${scale}.${run}${kind}.log | tail -1
      echo -n "       "
      fgrep sda vacuum_iostat_s${scale}.${run}${kind}.log | awk '{ print $6 " " $7 }' | python -c '
import sys ; tr = tw = 0
for l in sys.stdin:
   r, w = map(float, l.strip().split())
   tr += r
   tw += w
print "read %.2f GB \t write %.2f GB" % (tr * 60 / 1024.0, tw * 60 / 1024.0)
'
    done
  done
done

