#! /bin/bash dbname="postgres" function insert_result() { psql ${dbname} -f - > /dev/null <>$f 1>/dev/null cat $f 1>&2 cat $f | egrep "INFO: *\"t\": found " | sed -e 's/^.* versions in \([0-9]*\) .*$/\1/' rm $f } function update_result_bufs() { local test_no=$1 local delratio=$2 local vac_no=$3 local bufs=$4 psql ${dbname} -c "update result set bufs=${bufs} where \"#\"=$test_no and \"del%\"=$delratio and \"##\"=$vac_no" >/dev/null } function store_result() { local test_no=$1 local delratio=$2 scanned_bufs=`vac_with_bufs` insert_result $test_no $delratio 1 update_result_bufs $test_no $delratio 1 $scanned_bufs # scanned_bufs=`vac_with_bufs` # insert_result $test_no $delratio 2 # update_result_bufs $test_no $delratio 2 $scanned_bufs } function test1() { local delratio=$1 echo "### test1 ratio = $delratio" psql ${dbname} -f - > /dev/null < /dev/null < /dev/null <