cockroach: Index | Files

package pgbench

import ""


Package Files

query.go setup.go

func CreateAndConnect Uses

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 Uses

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 Uses

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

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

func SetupBenchDB Uses

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 Uses

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.

Package pgbench imports 7 packages (graph). Updated 2017-03-13. Refresh now. Tools for package owners. This is a dead-end fork (no commits since the fork).