A simple tool to benchmark PostgreSQL queries.
These instructions will guide you on how to set up and run the project on your local machine.
To run this project, you will need the following tools:
First, Clone this repository locally:
git clone https://github.com/marcelohmariano/pg-bench
Build the benchmark binary:
cd pg-bench
make all
The command above will generate the binary at ./bin/pg-bench
.
You can run the benchmark binary like so:
./bin/pg-bench -u "<user>:<pass>@<host>:<port>/<dbname>" -f <sql_file>
After running it, you should see an output similar to this:
Statements:
Total: 200
Succeeded: 200
Failed: 0
Durations:
Min: 66.114373ms
Max: 242.215678ms
Average: 158.03909ms
Median: 145.065445ms
Overall: 2.730135061s
You can run the tests by running the make test
from a terminal.
This project uses golangci-lint for linting Go
source files. You can run the linters by running make lint
from a terminal.