Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

Commit f0ccd41

Browse files
author
Michel Pelletier
committed
dump can be config file for pgbench run.
1 parent e4a3fcb commit f0ccd41

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

nancy_run.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,6 +1231,9 @@ function restore_dump() {
12311231
pgdmp)
12321232
docker_exec bash -c "pg_restore -j $CPU_CNT --no-owner --no-privileges -U postgres -d $DB_NAME $MACHINE_HOME/$DB_DUMP_FILENAME" || true
12331233
;;
1234+
pgbnch)
1235+
docker_exec bash -c "source $MACHINE_HOME/$DB_DUMP_FILENAME; pgbench -U postgres -i -s \$PGBENCH_SCALE $DB_NAME" || true
1236+
;;
12341237
esac
12351238
END_TIME=$(date +%s);
12361239
DURATION=$(echo $((END_TIME-OP_START_TIME)) | awk '{printf "%d:%02d:%02d", $1/3600, ($1/60)%60, $1%60}')
@@ -1404,6 +1407,9 @@ function execute_workload() {
14041407
else
14051408
docker_exec bash -c "pgreplay -r -j $MACHINE_HOME/$WORKLOAD_FILE_NAME"
14061409
fi
1410+
elif [ "$DB_DUMP_EXT" = "pgbnch" ]; then
1411+
msg "Running pgbench..."
1412+
docker_exec bash -c "source $MACHINE_HOME/$DB_DUMP_FILENAME; pgbench -c \$PGBENCH_CLIENTS -j \$PGBENCH_JOBS -t \$PGBENCH_TRANSACTIONS -U postgres $DB_NAME"
14071413
else
14081414
if ([ ! -z ${WORKLOAD_CUSTOM_SQL+x} ] && [ "$WORKLOAD_CUSTOM_SQL" != "" ]); then
14091415
WORKLOAD_CUSTOM_FILENAME=$(basename $WORKLOAD_CUSTOM_SQL)

test.pgbnch

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export PGBENCH_SCALE="3"
2+
export PGBENCH_CLIENTS="1"
3+
export PGBENCH_JOBS="1"
4+
export PGBENCH_TRANSACTIONS="100"

0 commit comments

Comments
 (0)