Documentation
¶
Index ¶
- Constants
- func BenchmarkNames() []string
- type Benchmark
- type BenchmarkOpts
- type CommonOpts
- type MySQLOpts
- type OLTPBench
- func (o *OLTPBench) Done() error
- func (o *OLTPBench) Event(ctx context.Context) (numReads, numWrites, numOthers, numIgnoredErros uint64, err error)
- func (o *OLTPBench) Init(ctx context.Context) error
- func (o *OLTPBench) PreEvent(ctx context.Context) error
- func (o *OLTPBench) Prepare(ctx context.Context) error
- type PgSQLOpts
- type SpannerOpts
Constants ¶
View Source
const ( DBDriverMySQL = "mysql" DBDriverPgSQL = "pgsql" DBDriverSpanner = "spanner" )
View Source
const ( NameOLTPReadOnly = "oltp_read_only" NameOLTPReadWrite = "oltp_read_write" OptSSLOn = "on" OptSSLOff = "off" OptIgnoreErrsAll = "all" OptDBPreparedStmtAuto = "auto" OptDBPreparedStmtDisable = "disable" )
Variables ¶
This section is empty.
Functions ¶
func BenchmarkNames ¶
func BenchmarkNames() []string
Types ¶
type Benchmark ¶
type Benchmark interface {
// initialize before both Prepare and Event
Init(context.Context) error
// finalize after both Prepare and Event
Done() error
// when prepare command is issued
Prepare(context.Context) error
// when run command is issued, PreEvent() is called once in a benchmark
PreEvent(context.Context) error
// when run command is issued, Event() is called in a loop
Event(context.Context) (numReads, numWrites, numOthers, numIgnoredErros uint64, err error)
}
func BenchmarkFactory ¶
func BenchmarkFactory(testname string, opt *BenchmarkOpts) (Benchmark, error)
type BenchmarkOpts ¶
type BenchmarkOpts struct {
CommonOpts
MySQLOpts `group:"MySQL" description:"MySQL options"`
PgSQLOpts `group:"PostgreSQL" description:"PostgreSQL options"`
SpannerOpts `group:"Spanner" description:"Google Cloud Spanner options"`
}
type CommonOpts ¶
type CommonOpts struct {
Tables int `long:"tables" description:"number of tables" default:"1"`
TableSize int `long:"table_size" description:"number of rows per table" default:"10000"`
TableSizeP int `long:"table-size" description:"alias of --table_size"`
DBDriver string `` //nolint:staticcheck
/* 126-byte string literal not displayed */
DBPreparedStmt string `long:"db-ps-mode" choice:"auto" choice:"disable" description:"prepared statements usage mode" default:"auto"` //nolint:staticcheck
}
type MySQLOpts ¶
type MySQLOpts struct {
MySQLHost string `long:"mysql-host" description:"MySQL server host" default:"localhost"`
MySQLPort int `long:"mysql-port" description:"MySQL server port" default:"3306"`
MySQLUser string `long:"mysql-user" description:"MySQL user" default:"sbtest"`
MySQLPassword string `long:"mysql-password" env:"MYSQL_PWD" description:"MySQL password" default:""`
MySQLDB string `long:"mysql-db" description:"MySQL database name" default:"sbtest"`
MySQLSSL string `long:"mysql-ssl" choice:"on" choice:"off" description:"use SSL connections" default:"off"` //nolint:staticcheck
MySQLIgnoreErrs string `long:"mysql-ignore-errors" description:"list of errors to ignore, or \"all\"" default:"1213,1020,1205"`
}
type OLTPBench ¶
type OLTPBench struct {
// contains filtered or unexported fields
}
type PgSQLOpts ¶
type PgSQLOpts struct {
PgSQLHost string `long:"pgsql-host" description:"PostgreSQL server host" default:"localhost"`
PgSQLPort int `long:"pgsql-port" description:"PostgreSQL server port" default:"5432"`
PgSQLUser string `long:"pgsql-user" description:"PostgreSQL user" default:"sbtest"`
PgSQLPassword string `long:"pgsql-password" env:"PGPASSWORD" description:"PostgreSQL password" default:""`
PgSQLDB string `long:"pgsql-db" description:"PostgreSQL database name" default:"sbtest"`
PgSQLSSL string `long:"pgsql-ssl" choice:"on" choice:"off" description:"use SSL connections" default:"off"` //nolint:staticcheck
PgSQLIgnoreErrs string `long:"pgsql-ignore-errors" description:"list of errors to ignore, or \"all\"" default:"40P01,23505,40001"`
}
type SpannerOpts ¶
Click to show internal directories.
Click to hide internal directories.