PostgreSQL Benchmark
A simple tool to benchmark PostgreSQL queries.
Getting Started
These instructions will guide you on how to set up and run the project on your
local machine.
Prerequisites
To run this project, you will need the following tools:
Build and Run
Getting the sources
First, Clone this repository locally:
git clone https://github.com/marcelohmariano/pg-bench
Build
Build the benchmark binary:
cd pg-bench
make all
The command above will generate the binary at ./bin/pg-bench
.
Run
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
Testing
You can run the tests by running the make test
from a terminal.
Linting
This project uses golangci-lint for linting Go
source files. You can run the linters by running make lint
from a terminal.