benchdb

command module
v0.0.0-...-ed1bd00 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

README

benchdb

Status

go test go build

Build

Requirements

The following binaries must be installed in your system

  • psql
  • docker
Steps

NOTE: During the db config process, the password will be asked via prompt.

It is "postgres" and has to be introduced manually.

Manual procedure
  • Create, configure and populate database
make db
  • Create bin/benchdb
make build
  • Run bin/benchdb Usage as follows
$ bin/benchdb -help
  -csv-file string
        path to query csv file (default "data-file.csv")
  -max-threads int
        max threads to process csv (default 1)

Example:
bin/benchdb -csv-file test/query.csv
Automatic procedure
  • Alternatively a test-run is available This will set the db up and running, and run a query test suite
make test-run
Additional Makefile targets
  • Clean binary
make clean
  • Run test suite
make test
  • Run coverage report
make coverage
  • View docs in browser
make docs

Statistics gathered

  • number of queries run
  • total processing time of all queries (measure every query processing time)
  • max query time
  • min query time
  • avg query time
  • median query time

Technical debt

  • Divide packages instead of using only package main
  • Use real production-ready folder tree, inside internal/ and divided by pkg/ and cmd/
  • Create doc.go per package
  • Test coverage 100%
  • Use logrus to log by level
  • Modify timescaledb entrypoint to accept scripts from stdin
  • Introduce password automatically during workflow
  • Introduce proper sticky worker-pool

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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