suite

package
v0.0.0-...-43a2903 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2018 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTable

func CreateTable(db *sql.DB, tableName, tableSchema string) error

func DropTable

func DropTable(db *sql.DB, tableName string) error

func ParallelExec

func ParallelExec(exec ExecFunc, duration Duration, numThreads int)

func RandomAsciiBytes

func RandomAsciiBytes(r *rand.Rand, size int) []byte

func RecreateTable

func RecreateTable(db *sql.DB, tableName, tableSchema string) error

func RegisterBenchSuite

func RegisterBenchSuite(name string, builder BenchSuiteBuilder)

Types

type BenchCase

type BenchCase interface {
	Name() string
	Run(*sql.DB) (*CaseResult, error)
}

type BenchFunc

type BenchFunc func(*rand.Rand) (OPKind, error)

type BenchSuite

type BenchSuite interface {
	Name() string
	Run(Cluster) ([]*CaseResult, error)
}

func NewBenchSuites

func NewBenchSuites(fpath string) ([]BenchSuite, error)

type BenchSuiteBuilder

type BenchSuiteBuilder func(toml.MetaData, toml.Primitive) BenchSuite

type BenchSuiteConfigs

type BenchSuiteConfigs struct {
	Suites map[string]toml.Primitive
}

type BlockWriteCase

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

func NewBlockWriteCase

func NewBlockWriteCase(s *BlockWriteSuite) *BlockWriteCase

func (*BlockWriteCase) Name

func (c *BlockWriteCase) Name() string

func (*BlockWriteCase) Run

func (c *BlockWriteCase) Run(db *sql.DB) (*CaseResult, error)

type BlockWriteConfig

type BlockWriteConfig struct {
	Duration     Duration `toml:"duration"`
	NumThreads   int      `toml:"num_threads"`
	MinBlockSize int      `toml:"min_block_size"`
	MaxBlockSize int      `toml:"max_block_size"`
}

type BlockWriteSuite

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

func NewBlockWriteSuite

func NewBlockWriteSuite(cfg *BlockWriteConfig) *BlockWriteSuite

func (*BlockWriteSuite) Name

func (s *BlockWriteSuite) Name() string

func (*BlockWriteSuite) Run

func (s *BlockWriteSuite) Run(cluster Cluster) ([]*CaseResult, error)

type CaseResult

type CaseResult struct {
	Name string      `json:"name"`
	Stat *StatResult `json:"stat"`
}

func NewCaseResult

func NewCaseResult(name string, stat *StatResult) *CaseResult

func ParallelBench

func ParallelBench(c BenchCase, exec BenchFunc, duration Duration, numThreads int) (*CaseResult, error)

func ParallelSQLBench

func ParallelSQLBench(c BenchCase, exec SQLBenchFunc, duration Duration, numThreads int, db *sql.DB) (*CaseResult, error)

func RunBenchCase

func RunBenchCase(c BenchCase, db *sql.DB) (*CaseResult, error)

func RunBenchCases

func RunBenchCases(cases []BenchCase, db *sql.DB) ([]*CaseResult, error)

func RunBenchCasesWithReset

func RunBenchCasesWithReset(cases []BenchCase, cluster Cluster) ([]*CaseResult, error)

type DiffType

type DiffType int8

DiffType defines the type of a diff item.

type Duration

type Duration struct {
	time.Duration
}

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(text []byte) (err error)

type ExecFunc

type ExecFunc func(*rand.Rand)

type OPKind

type OPKind int
const (
	OPRead OPKind = iota
	OPWrite
	OPBegin
	OPCommit
	OPRollback
)

type SQLBenchFunc

type SQLBenchFunc func(*StatDB, *rand.Rand) error

type StatDB

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

func NewStatDB

func NewStatDB(db *sql.DB) *StatDB

func (*StatDB) Begin

func (s *StatDB) Begin() (*StatTx, error)

func (*StatDB) BeginTx

func (s *StatDB) BeginTx(ctx context.Context, opts *sql.TxOptions) (*StatTx, error)

func (*StatDB) Close

func (s *StatDB) Close() error

func (*StatDB) Exec

func (s *StatDB) Exec(query string, args ...interface{}) (sql.Result, error)

func (*StatDB) ExecContext

func (s *StatDB) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)

func (*StatDB) Prepare

func (s *StatDB) Prepare(query string) (*StatStmt, error)

func (*StatDB) PrepareContext

func (s *StatDB) PrepareContext(ctx context.Context, query string) (*StatStmt, error)

func (*StatDB) Query

func (s *StatDB) Query(query string, args ...interface{}) (*sql.Rows, error)

func (*StatDB) QueryContext

func (s *StatDB) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)

func (*StatDB) QueryRow

func (s *StatDB) QueryRow(query string, args ...interface{}) *sql.Row

func (*StatDB) QueryRowContext

func (s *StatDB) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row

func (*StatDB) Result

func (s *StatDB) Result() *StatResult

func (*StatDB) Start

func (s *StatDB) Start()

Wrapper for DB (*sql.db)

type StatHistogram

type StatHistogram struct {
	AvgMs        float64
	MaxMs        float64
	Percentile   float64
	PercentileMs float64
}

func NewStatHistogram

func NewStatHistogram(h *hdrhistogram.Histogram, percent float64) StatHistogram

type StatManager

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

func NewStatManager

func NewStatManager() *StatManager

func (*StatManager) Close

func (s *StatManager) Close()

func (*StatManager) Record

func (s *StatManager) Record(op OPKind, err error, duration time.Duration)

func (*StatManager) Result

func (s *StatManager) Result() *StatResult

func (*StatManager) Start

func (s *StatManager) Start()

type StatResult

type StatResult struct {
	Qps       float64
	Eps       float64
	Total     float64
	Error     float64
	Duration  float64
	Histogram StatHistogram
}

func (*StatResult) FormatJSON

func (s *StatResult) FormatJSON() string

func (*StatResult) Record

func (s *StatResult) Record(op OPKind, err error)

func (*StatResult) Update

func (s *StatResult) Update(d time.Duration, h StatHistogram)

type StatStmt

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

func (*StatStmt) Exec

func (s *StatStmt) Exec(args ...interface{}) (sql.Result, error)

Wrapper for Statement (*sql.Stmt)

func (*StatStmt) ExecContext

func (s *StatStmt) ExecContext(ctx context.Context, args ...interface{}) (sql.Result, error)

func (*StatStmt) Query

func (s *StatStmt) Query(args ...interface{}) (*sql.Rows, error)

func (*StatStmt) QueryContext

func (s *StatStmt) QueryContext(ctx context.Context, args ...interface{}) (*sql.Rows, error)

func (*StatStmt) QueryRow

func (s *StatStmt) QueryRow(args ...interface{}) *sql.Row

func (*StatStmt) QueryRowContext

func (s *StatStmt) QueryRowContext(ctx context.Context, args ...interface{}) *sql.Row

type StatTx

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

func (*StatTx) Commit

func (s *StatTx) Commit() error

Wrapper for Trasaction (*sql.Tx)

func (*StatTx) Exec

func (s *StatTx) Exec(query string, args ...interface{}) (sql.Result, error)

func (*StatTx) ExecContext

func (s *StatTx) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)

func (*StatTx) Query

func (s *StatTx) Query(query string, args ...interface{}) (*sql.Rows, error)

func (*StatTx) QueryContext

func (s *StatTx) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)

func (*StatTx) QueryRow

func (s *StatTx) QueryRow(query string, args ...interface{}) *sql.Row

func (*StatTx) QueryRowContext

func (s *StatTx) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row

func (*StatTx) Rollback

func (s *StatTx) Rollback() error

type SysbenchCase

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

func NewSysbenchCase

func NewSysbenchCase(s *SysbenchSuite, name string) *SysbenchCase

func (*SysbenchCase) Name

func (c *SysbenchCase) Name() string

func (*SysbenchCase) Run

func (c *SysbenchCase) Run(*sql.DB) (*CaseResult, error)

type SysbenchConfig

type SysbenchConfig struct {
	ScriptsDir string `toml:"scripts_dir"`
}

type SysbenchSuite

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

func NewSysbenchSuite

func NewSysbenchSuite(cfg *SysbenchConfig) *SysbenchSuite

func (*SysbenchSuite) Name

func (s *SysbenchSuite) Name() string

func (*SysbenchSuite) Run

func (s *SysbenchSuite) Run(cluster Cluster) ([]*CaseResult, error)

type TPCHConfig

type TPCHConfig struct {
	Host       string `toml:"host"`
	Port       int    `toml:"port"`
	ScriptsDir string `toml:"scripts_dir"`
}

type TPCHSuite

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

func NewTPCHSuite

func NewTPCHSuite(cfg *TPCHConfig) *TPCHSuite

func (*TPCHSuite) Name

func (s *TPCHSuite) Name() string

func (*TPCHSuite) Run

func (s *TPCHSuite) Run(cluster Cluster) ([]*CaseResult, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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