blob: 132ed971ee6b70afcf7bcc387ee8a072d3182acc [file] [log] [blame]
Yulia Portnova058a2882015-02-20 17:59:12 +02001#!/bin/bash
Yulia Portnova7ddfa732015-02-24 17:32:58 +02002set -e
Yulia Portnova058a2882015-02-20 17:59:12 +02003
Yulia Portnova7ddfa732015-02-24 17:32:58 +02004CLIENTS=${CLIENTS:-"4 8"}
5TRANSACTINOS_PER_CLIENT=${TRANSACTINOS_PER_CLIENT:-"1 2"}
Yulia Portnova058a2882015-02-20 17:59:12 +02006
7
Yulia Portnova7ddfa732015-02-24 17:32:58 +02008sudo -u postgres createdb -O postgres pgbench
9sudo -u postgres pgbench -i -U postgres pgbench
Yulia Portnova058a2882015-02-20 17:59:12 +020010
Yulia Portnova058a2882015-02-20 17:59:12 +020011
12for num_clients in $CLIENTS; do
13 for trans_per_cl in $TRANSACTINOS_PER_CLIENT; do
14 tps_all=''
15 for i in 1 2 3 4 5 6 7 8 9 10; do
Yulia Portnova7ddfa732015-02-24 17:32:58 +020016 echo -n "$num_clients $trans_per_cl:"
17 sudo -u postgres pgbench -c $num_clients -n -t $trans_per_cl -j 4 -r -U postgres pgbench |
18 grep "(excluding connections establishing)" | awk {'print $3'}
Yulia Portnova058a2882015-02-20 17:59:12 +020019 done
Yulia Portnova058a2882015-02-20 17:59:12 +020020 done
21done
22
Yulia Portnova7ddfa732015-02-24 17:32:58 +020023sudo -u postgres dropdb pgbench
Yulia Portnova058a2882015-02-20 17:59:12 +020024
Yulia Portnova7ddfa732015-02-24 17:32:58 +020025exit 0
Yulia Portnova058a2882015-02-20 17:59:12 +020026