Skip to content

A tool built with the intent to teach Go to other people

License

Notifications You must be signed in to change notification settings

marcelohmariano/pg-bench

Repository files navigation

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.

About

A tool built with the intent to teach Go to other people

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published