Documentation
¶
Index ¶
- func NewWorkloader(db *sql.DB, cfg *Config) (workload.Workloader, error)
- type Config
- type Workloader
- func (w *Workloader) Check(ctx context.Context, threadID int) error
- func (w *Workloader) CheckPrepare(ctx context.Context, threadID int) error
- func (w *Workloader) Cleanup(ctx context.Context, threadID int) error
- func (w *Workloader) CleanupThread(ctx context.Context, threadID int)
- func (w *Workloader) DBName() string
- func (w *Workloader) DataGen() bool
- func (w *Workloader) InitThread(ctx context.Context, threadID int) context.Context
- func (w *Workloader) Name() string
- func (w *Workloader) Prepare(ctx context.Context, threadID int) error
- func (w *Workloader) Run(ctx context.Context, threadID int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewWorkloader ¶
NewWorkloader creates the tpc-c workloader
Types ¶
type Config ¶
type Config struct {
DBName string
Threads int
Parts int
Warehouses int
UseFK bool
Isolation int
CheckAll bool
OutputDir string
SpecifiedTables string
}
Config is the configuration for tpcc workload
type Workloader ¶
type Workloader struct {
// contains filtered or unexported fields
}
Workloader is TPCC workload
func (*Workloader) Check ¶
func (w *Workloader) Check(ctx context.Context, threadID int) error
Check implements Workloader interface
func (*Workloader) CheckPrepare ¶
func (w *Workloader) CheckPrepare(ctx context.Context, threadID int) error
CheckPrepare implements Workloader interface
func (*Workloader) Cleanup ¶
func (w *Workloader) Cleanup(ctx context.Context, threadID int) error
Cleanup implements Workloader interface
func (*Workloader) CleanupThread ¶
func (w *Workloader) CleanupThread(ctx context.Context, threadID int)
CleanupThread implements Workloader interface
func (*Workloader) DBName ¶
func (w *Workloader) DBName() string
DBName returns the name of test db.
func (*Workloader) DataGen ¶
func (w *Workloader) DataGen() bool
DataGen returns a bool to represent whether to generate csv data or load data to db.
func (*Workloader) InitThread ¶
InitThread implements Workloader interface
Click to show internal directories.
Click to hide internal directories.