summaryrefslogtreecommitdiff
path: root/runset
blob: af3f6018368ed4c0877ea6882e7910ef47a30e3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash

. ./config

# Confirm we have a useful pgbench to run
if [ ! -f $PGBENCHBIN ]; then
  echo ERROR:  cannot find pgbench binary $PGBENCHBIN , aborting
  exit
fi

for SCALE in $SCALES; do
  #
  # Have a consistant, clean set of pgbench tables to start 
  # each test run with
  #

  if [ "$SKIPINIT" -ne "1" ]; then
    echo Removing old pgbench tables
    TESTPSQL="psql -h $TESTHOST -U $TESTUSER -p $TESTPORT -d $TESTDB"
    $TESTPSQL -c "drop table ${TABLEPREFIX}accounts; drop table ${TABLEPREFIX}branches; drop table ${TABLEPREFIX}tellers; drop table ${TABLEPREFIX}history;"
    $TESTPSQL -c "vacuum full"

    echo Creating new pgbench tables
    $PGBENCHBIN -i -s $SCALE -h $TESTHOST -U $TESTUSER -p $TESTPORT $TESTDB
  fi
  #
  # Run the main test
  #
  for (( t=1; t<=$SETTIMES; t++ )); do
    for c in $SETCLIENTS; do
      echo Run set \#$t of $SETTIMES with $c clients scale=$SCALE
      ./benchwarmer $c
      echo
    done
  done
done

./webreport