tpcc_runner

package
v0.40.4 Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

README

TPCC runner is a tool for running TPCC tests against sql servers. These tests run against the Percona Labs repo here.

The tool requires a json config file to run.

$ go run cmd/main.go --config=sample-tpcc-config.json

Note to this run this locally you need to have the TPCC repo cloned. The ScriptDir variable should then be linked to the path of the cloned repo.

Configuration:

{
  "Servers": "[...]",
  "ScriptDir":"/Users/vinairachakonda/go/src/dolthub/sysbench-tpcc",
  "ScaleFactors": [1]
}

Servers: The server defintions to run the benchmark against. Accepts Dolt and MySQL configuratiosn.

ScriptDir: The directory of the TPCC testing scripts

ScaleFactors: The number of warehouse to be generated in the test case.

Note that this configuration is still incomplete for the amount of the variable TPCC varies. This intentional as we want expose small amounts of independent variables until Dolt gets more robust. See config.go to get a breakdown of all the variables TPCC varies.

As of now the TPCC runner test requires the environment variable DOLT_TRANSACTION_MERGE_STOMP to be 1.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BenchmarkDolt

func BenchmarkDolt(ctx context.Context, tppcConfig *TpccBenchmarkConfig, serverConfig *sysbench_runner.ServerConfig) (sysbench_runner.Results, error)

BenchmarkDolt executes a set of tpcc tests against a dolt server.

func BenchmarkMysql

func BenchmarkMysql(ctx context.Context, config *TpccBenchmarkConfig, serverConfig *sysbench_runner.ServerConfig) (sysbench_runner.Results, error)

BenchmarkMysql benchmarks a mysql server based on the provided configurations.

func FromConfigsNewResult

func FromConfigsNewResult(config *TpccBenchmarkConfig, serverConfig *sysbench_runner.ServerConfig, test *TpccTest, suiteId string, idFunc func() string) (*sysbench_runner.Result, error)

FromConfigsNewResult returns a new result with some fields set based on the provided configs

func FromOutputResult

func FromOutputResult(output []byte, config *TpccBenchmarkConfig, serverConfig *sysbench_runner.ServerConfig, test *TpccTest, suiteId string, idFunc func() string) (*sysbench_runner.Result, error)

FromOutputResult accepts raw sysbench run output and returns the Result

func Run

func Run(config *TpccBenchmarkConfig) error

Types

type TpccBenchmarkConfig

type TpccBenchmarkConfig struct {
	// RuntimeOS is the platform the benchmarks ran on
	RuntimeOS string

	// RuntimeGoArch is the runtime architecture
	RuntimeGoArch string

	// ScriptDir represents the location of the TPCC tests
	ScriptDir string

	// Servers are the servers to benchmark.
	Servers []*sysbench_runner.ServerConfig

	// ScaleFactors represent the scale at which to run each TpccBenchmark at.
	ScaleFactors []int
}

TpccBenchmarkConfig represents a configuration for an execution of the TPCC Benchmark. It executes a series of tests against different ServerConfigurations.

func FromFileConfig

func FromFileConfig(configPath string) (*TpccBenchmarkConfig, error)

FromFileConfig returns a validated Config based on the config file at the configPath

func NewTpccConfig

func NewTpccConfig() *TpccBenchmarkConfig

type TpccTest

type TpccTest struct {
	// Id represents a unique test id
	Id string

	// Name represents the name of the test case
	Name string

	// Params are associated parameters this test runs with
	Params *TpccTestParams
}

TpccTest encapsulates an End to End prepare, run, cleanup test case.

func NewTpccTest

func NewTpccTest(name string, params *TpccTestParams) *TpccTest

NewTpccTest instantiates and returns a TPCC test.

func (*TpccTest) TpccCleanup

func (t *TpccTest) TpccCleanup(ctx context.Context, serverConfig *sysbench_runner.ServerConfig, scriptDir string) *exec.Cmd

TpccCleanup prepares the cleanup executable for the Cleanup step.

func (*TpccTest) TpccPrepare

func (t *TpccTest) TpccPrepare(ctx context.Context, serverConfig *sysbench_runner.ServerConfig, scriptDir string) *exec.Cmd

TpccPrepare prepares the command executable for the Prepare step.

func (*TpccTest) TpccRun

func (t *TpccTest) TpccRun(ctx context.Context, serverConfig *sysbench_runner.ServerConfig, scriptDir string) *exec.Cmd

TpccRun prepares the command executable for the Run step.

type TpccTestParams

type TpccTestParams struct {
	// NumThreads represents the number of threads running queries concurrently.
	NumThreads int

	// ScaleFactor represents the number of warehouse to test this at scale.
	ScaleFactor int

	// Tables represents the number of tables created per warehouse.
	Tables int

	// TrxLevel represents what transaction level to use
	TrxLevel string

	// ReportCSV determines whether to report output as a csv.
	ReportCSV bool

	// ReportInterval defines how often the tpcc benchmark outputs performance stats.
	ReportInterval int

	// Time represents how long
	Time int
}

func NewDefaultTpccParams

func NewDefaultTpccParams() *TpccTestParams

NewDefaultTpccParams returns default TpccTestParams.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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