Documentation
¶
Index ¶
- func CreateTable(db *sql.DB, tableName, tableSchema string) error
- func DropTable(db *sql.DB, tableName string) error
- func ParallelExec(exec ExecFunc, duration Duration, numThreads int)
- func RandomAsciiBytes(r *rand.Rand, size int) []byte
- func RecreateTable(db *sql.DB, tableName, tableSchema string) error
- func RegisterBenchSuite(name string, builder BenchSuiteBuilder)
- type BenchCase
- type BenchFunc
- type BenchSuite
- type BenchSuiteBuilder
- type BenchSuiteConfigs
- type BlockWriteCase
- type BlockWriteConfig
- type BlockWriteSuite
- type CaseResult
- func NewCaseResult(name string, stat *StatResult) *CaseResult
- func ParallelBench(c BenchCase, exec BenchFunc, duration Duration, numThreads int) (*CaseResult, error)
- func ParallelSQLBench(c BenchCase, exec SQLBenchFunc, duration Duration, numThreads int, db *sql.DB) (*CaseResult, error)
- func RunBenchCase(c BenchCase, db *sql.DB) (*CaseResult, error)
- func RunBenchCases(cases []BenchCase, db *sql.DB) ([]*CaseResult, error)
- func RunBenchCasesWithReset(cases []BenchCase, cluster Cluster) ([]*CaseResult, error)
- type DiffType
- type Duration
- type ExecFunc
- type OPKind
- type SQLBenchFunc
- type StatDB
- func (s *StatDB) Begin() (*StatTx, error)
- func (s *StatDB) BeginTx(ctx context.Context, opts *sql.TxOptions) (*StatTx, error)
- func (s *StatDB) Close() error
- func (s *StatDB) Exec(query string, args ...interface{}) (sql.Result, error)
- func (s *StatDB) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (s *StatDB) Prepare(query string) (*StatStmt, error)
- func (s *StatDB) PrepareContext(ctx context.Context, query string) (*StatStmt, error)
- func (s *StatDB) Query(query string, args ...interface{}) (*sql.Rows, error)
- func (s *StatDB) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func (s *StatDB) QueryRow(query string, args ...interface{}) *sql.Row
- func (s *StatDB) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
- func (s *StatDB) Result() *StatResult
- func (s *StatDB) Start()
- type StatHistogram
- type StatManager
- type StatResult
- type StatStmt
- func (s *StatStmt) Exec(args ...interface{}) (sql.Result, error)
- func (s *StatStmt) ExecContext(ctx context.Context, args ...interface{}) (sql.Result, error)
- func (s *StatStmt) Query(args ...interface{}) (*sql.Rows, error)
- func (s *StatStmt) QueryContext(ctx context.Context, args ...interface{}) (*sql.Rows, error)
- func (s *StatStmt) QueryRow(args ...interface{}) *sql.Row
- func (s *StatStmt) QueryRowContext(ctx context.Context, args ...interface{}) *sql.Row
- type StatTx
- func (s *StatTx) Commit() error
- func (s *StatTx) Exec(query string, args ...interface{}) (sql.Result, error)
- func (s *StatTx) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- func (s *StatTx) Query(query string, args ...interface{}) (*sql.Rows, error)
- func (s *StatTx) QueryContext(ctx context.Context, query string, args ...interface{}) (*sql.Rows, error)
- func (s *StatTx) QueryRow(query string, args ...interface{}) *sql.Row
- func (s *StatTx) QueryRowContext(ctx context.Context, query string, args ...interface{}) *sql.Row
- func (s *StatTx) Rollback() error
- type SysbenchCase
- type SysbenchConfig
- type SysbenchSuite
- type TPCHConfig
- type TPCHSuite
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParallelExec ¶
func RegisterBenchSuite ¶
func RegisterBenchSuite(name string, builder BenchSuiteBuilder)
Types ¶
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 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 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 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 Duration ¶
func (*Duration) UnmarshalText ¶
type StatDB ¶
type StatDB struct {
// contains filtered or unexported fields
}
func (*StatDB) ExecContext ¶
func (*StatDB) PrepareContext ¶
func (*StatDB) QueryContext ¶
func (*StatDB) QueryRowContext ¶
func (*StatDB) Result ¶
func (s *StatDB) Result() *StatResult
type StatHistogram ¶
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) ExecContext ¶
func (*StatStmt) QueryContext ¶
type StatTx ¶
type StatTx struct {
// contains filtered or unexported fields
}
func (*StatTx) ExecContext ¶
func (*StatTx) QueryContext ¶
func (*StatTx) QueryRowContext ¶
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 TPCHSuite ¶
type TPCHSuite struct {
// contains filtered or unexported fields
}
func NewTPCHSuite ¶
func NewTPCHSuite(cfg *TPCHConfig) *TPCHSuite
func (*TPCHSuite) Run ¶
func (s *TPCHSuite) Run(cluster Cluster) ([]*CaseResult, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.