This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import time | |
| import psycopg | |
| from psycopg.rows import dict_row | |
| from datetime import datetime | |
| CONNSTR = "dbname=postgres user=postgres port=5434" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import psycopg | |
| import random | |
| import time | |
| CONNSTR = "postgresql://james:[email protected]:5432/postgres?sslmode=require" | |
| SCALE = 10 | |
| BASE_SQL = """ | |
| BEGIN; | |
| SELECT abalance FROM pgbench_accounts WHERE aid = {aid}; | |
| SELECT abalance FROM pgbench_accounts WHERE aid = {aid2}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -euo pipefail | |
| SCALE=1200 | |
| FF=80 | |
| UNLOGGED="unlogged" # set to "" for normal tables | |
| UNLOGGED="" | |
| ROW_CHANGES=100000 # 0.1% of scale 1000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # PS Running in CRON mode - meaning output produced only on errors | |
| # Expected inputs: | |
| # 1) the pgbackrest config file path, e.g. /etc/pgbackrest/15/main/pgbackrest.conf | |
| # 2) the stanza name | |
| # 3) max age threshold in seconds of last valid backup. | |
| # errors if no valid backup within the threshold |
OlderNewer