pgbench

package
v0.0.0-...-872dfdc Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAndConnect

func CreateAndConnect(pgURL url.URL, name string) (*gosql.DB, error)

CreateAndConnect connects and creates the requested DB (dropping if exists) then returns a new connection to the created DB.

func ExecPgbench

func ExecPgbench(pgURL url.URL, dbname string, count int) (*exec.Cmd, error)

ExecPgbench returns a ready-to-run pgbench Cmd, that will run against the db specified by `pgURL`.

func RunOne

func RunOne(db *gosql.DB, r *rand.Rand, accounts int) error

RunOne executes one iteration of the query batch that `pgbench` executes.

func SetupBenchDB

func SetupBenchDB(db *gosql.DB, accounts int, quiet bool) error

SetupBenchDB sets up a db with the schema and initial data used by `pgbench`. The `-i` flag to `pgbench` is usually used to do this when testing postgres but the statements it generates use postgres-specific flags that cockroach does not support. The queries this script runs are based on a dump of a db created by `pgbench -i`, but sticking to the compatible subset that both cockroach and postgres support.

func SetupExec

func SetupExec(pgURL url.URL, name string, accounts, transactions int) (*exec.Cmd, error)

SetupExec creates and fills a DB and prepares a `pgbench` command to be run against it.

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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