pg-bench

module
v0.0.0-...-89949a1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2022 License: MIT

README

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.

Directories

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL