sysbench

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2025 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// https://github.com/akopytov/sysbench
	ConfigThreads   = "threads"
	ConfigEvents    = "events"
	ConfigTime      = "time"
	ConfigTableSize = "table-size"
	ConfigDBDriver  = "db-driver"
	ConfigDBDebug   = "db-debug"
)
View Source
const (
	// https://github.com/akopytov/sysbench/tree/master/src/lua
	OltpDelete      = "oltp_delete"
	OltpInsert      = "oltp_insert"
	OltpReadOnly    = "oltp_read_only"
	OltpReadWrite   = "oltp_read_write"
	OltpUpdateIndex = "oltp_update_index"
	OltpWriteOnly   = "oltp_write_only"
	OltpCommon      = "oltp_common"
)
View Source
const (
	DefaultTableSize = 10000
	DefaultThreads   = 1
	DefaultEvents    = 0
	DefaultTime      = 10
)

Variables

This section is empty.

Functions

func GenerateTempDBName

func GenerateTempDBName() string

GenerateTempDBName returns a temporary database name.

func Password

func Password() string

Password returns the default password for sysbench.

func RunCommand

func RunCommand(t *testing.T, cmd string, config *Config) error

RunCommand runs a sysbench command with the given configuration.

func User

func User() string

User returns the default user for sysbench.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config represents a sysbench configuration.

func NewConfig

func NewConfig() *Config

NewConfig returns a new config.

func NewDefaultConfig

func NewDefaultConfig() *Config

NewDefaultConfig returns a new default config.

func (*Config) Keys added in v1.6.0

func (config *Config) Keys() []string

Keys returns all config keys.

func (*Config) Set

func (config *Config) Set(name string, value string)

Set sets a config value.

func (*Config) SetBool

func (config *Config) SetBool(key string, value bool)

SetBool sets a config value as a boolean.

func (*Config) SetDBDebug

func (config *Config) SetDBDebug(value bool)

SetDBDebug sets the database debug.

func (*Config) SetDBDriver

func (config *Config) SetDBDriver(value string)

SetDBDriver sets the database driver.

func (*Config) SetEvents

func (config *Config) SetEvents(v int)

SetEvents sets the number of events.

func (*Config) SetSkipOnError added in v1.6.0

func (config *Config) SetSkipOnError(enabled bool)

SetSkipOnError sets the skip on error flag.

func (*Config) SetTableSize

func (config *Config) SetTableSize(v int)

SetTableSize sets the table size.

func (*Config) SetThreads

func (config *Config) SetThreads(v int)

SetThreads sets the number of threads.

func (*Config) SetTime

func (config *Config) SetTime(v int)

SetTime sets the time.

func (*Config) SkipOnError added in v1.6.0

func (config *Config) SkipOnError() bool

SkipOnError returns true if skip on error is enabled.

func (*Config) Value added in v1.6.0

func (config *Config) Value(name string) (string, bool)

Value returns a config value.

Jump to

Keyboard shortcuts

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