dbench

command module
v0.9.1-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 1 Imported by: 0

README

 

dbench

A convenience wrapper around pgbench that adds benchmarks persistence and plotting.

 

go.dev reference

 

About

Warning: At the time of writing, this project should be considered a PoC or barely usable alpha. It is not recommended to take the results of this benchmark too seriously.

DBench is a convenience wrapper around pgbench. Under the hood all benchmarks are run by pgbench.

DBench parses the result of each benchmarks and persists it in a database. This allows for easy comparisons of different benchmarks. The endgoal is for DBench to automatically generate multiple insightful plots that help with hunting down potential performance culprits.

Pre-requisites

  • PostgreSQL (we need a database to benchmark against)
  • pgbench (the actual benchmarking tool)
  • gnuplot (for plotting the results)

Install

Important: While the releases offer binaries for multiple platforms and architectures, only Linux is tested. If you are using a different OS, I do not guarantee that dbench will work as expected.

Download one of the releases for your system, or install using the provided install script:

curl -L https://tinyurl.com/install-dbench | bash

Usage

It is recommended to check the help page of the command line interface for more information on the available flags and commands.

Before you can run any benchmarks, you need to create a database and initialize it with pgbench. This can be done by running the following command:

Hint: Remember to replace the flags with your own values.

dbench init --dbname postgres --username postgres --host 127.0.0.1 --port 5432

Hint: dbench/pgbench expects the PGPASSWORD environment variable to be set. Currently no password flag is supported since I didn't need it and it enforces better security practices. This might very well change down the line.

Now, you can run your first benchmark using the following command:

dbench run --dbname postgres --username postgres --host 127.0.0.1 --port 5432

The benchmark will present you with an executable command once it is done. You can use this command to generate a plot of the results. It looks something like this:

dbench plot <benckmark-id>

Under the hood we generate gnuplot compatible data fields and a gnuplot script. The script is then executed and the plot is generated. The plot is saved in the current working directory as a PNG.

To check on old benchmarks, you can use the list command:

dbench list

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
ent
schema/pulid
Package pulid implements the pulid type.
Package pulid implements the pulid type.
internal
database
Package database provides functionalities for connecting, transferring and retrieving data to a database
Package database provides functionalities for connecting, transferring and retrieving data to a database
export
Package export provides functionality to export data in various formats.
Package export provides functionality to export data in various formats.
ui

Jump to

Keyboard shortcuts

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