posbench

module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: MIT

README

Benchmark your SQL query against TimescaleDB

MIT License

Maintenance Build

Latest Release release

Go Code reference

Contents

Demo

Demo

Features

  • posbench is a simple benchmarking tool, which can be used to benchmark SELECT query performance across multiple workers/clients against a TimescaleDB instance.

  • It takes a CSV file as input which contains the query specifications.

Usage

Usage of posbench:
  -buffer int
    	Buffer for streaming files to limit concurrency (default 10)
  -dbname string
    	postgress database (default "homework")
  -debug
    	enable debugging
  -host string
    	postgres hostname (default "localhost")
  -pass string
    	postgress pass
  -path string
    	CSV file to query data from Timescale instance (default "assets/query_params.csv")
  -port int
    	postgres port number (default 5432)
  -pretty
    	pretty printing of logs (default true)
  -runs int
    	number of times to run the benchmark (default 2)
  -user string
    	postgres user (default "postgres")
  -workerCount int
    	Number of concurrent workers processing data from db (default 10)

Running the code

You can run the code either using docker compose or directly using go on your machine.

Using docker compose
Prerequisites

To run posbench, follow below steps:

make container-up

To stop posbench and clean containers, follow below steps:

make container-down
Locally
Prerequisites
  • Go installed on your host.
  • PostgreSQL installed on your host. You will also need to have psql cli installed.
  • postgres running on a <port> on your host.

Make sure that your postgres in running on port 5432. If not, you can pass the -port flag.

# Build the code
make build

# Setup Timescale instance and go dependencies
make local

# Run the code
dist/posbench -port <port> # default is 5432

Development

Linting

Run linter and formatter using

make fmt
make lint
Testing
# Run unit test
make unit-test

# Run integration test
make local
make integration-test

Internals

See docs/architecture

Directories

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

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