Documentation ¶
Index ¶
- Constants
- func NewWorkloader(db *sql.DB, cfg *Config) (workload.Workloader, error)
- type CSVWorkLoader
- func (c *CSVWorkLoader) Check(_ context.Context, _ int) error
- func (c *CSVWorkLoader) CheckPrepare(_ context.Context, _ int) error
- func (c *CSVWorkLoader) Cleanup(_ context.Context, _ int) error
- func (c *CSVWorkLoader) CleanupThread(ctx context.Context, _ int)
- func (c *CSVWorkLoader) DBName() string
- func (c *CSVWorkLoader) FinishPlanReplayerDump() error
- func (c *CSVWorkLoader) InitThread(ctx context.Context, threadID int) context.Context
- func (c *CSVWorkLoader) IsPlanReplayerDumpEnabled() bool
- func (c *CSVWorkLoader) Name() string
- func (c *CSVWorkLoader) OutputStats(_ bool)
- func (c *CSVWorkLoader) Prepare(ctx context.Context, threadID int) error
- func (c *CSVWorkLoader) PreparePlanReplayerDump() error
- func (c *CSVWorkLoader) Run(_ context.Context, _ int) 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) FinishPlanReplayerDump() error
- func (w *Workloader) InitThread(ctx context.Context, threadID int) context.Context
- func (w *Workloader) IsPlanReplayerDumpEnabled() bool
- func (w *Workloader) Name() string
- func (w *Workloader) OutputStats(ifSummaryReport bool)
- func (w *Workloader) Prepare(ctx context.Context, threadID int) error
- func (w *Workloader) PreparePlanReplayerDump() error
- func (w *Workloader) Run(ctx context.Context, threadID int) error
Constants ¶
View Source
const ( PartitionTypeHash = iota + 1 PartitionTypeRange PartitionTypeListAsHash PartitionTypeListAsRange )
Variables ¶
This section is empty.
Functions ¶
func NewWorkloader ¶
NewWorkloader creates the tpc-c workloader
Types ¶
type CSVWorkLoader ¶ added in v1.0.4
type CSVWorkLoader struct {
// contains filtered or unexported fields
}
func NewCSVWorkloader ¶ added in v1.0.4
func NewCSVWorkloader(db *sql.DB, cfg *Config) (*CSVWorkLoader, error)
NewCSVWorkloader creates the tpc-c workloader to generate CSV files
func (*CSVWorkLoader) Check ¶ added in v1.0.4
func (c *CSVWorkLoader) Check(_ context.Context, _ int) error
CSV type doesn't support Check
func (*CSVWorkLoader) CheckPrepare ¶ added in v1.0.4
func (c *CSVWorkLoader) CheckPrepare(_ context.Context, _ int) error
CSV type doesn't support CheckPrepare
func (*CSVWorkLoader) Cleanup ¶ added in v1.0.4
func (c *CSVWorkLoader) Cleanup(_ context.Context, _ int) error
CSV type doesn't support Cleanup
func (*CSVWorkLoader) CleanupThread ¶ added in v1.0.4
func (c *CSVWorkLoader) CleanupThread(ctx context.Context, _ int)
func (*CSVWorkLoader) DBName ¶ added in v1.0.4
func (c *CSVWorkLoader) DBName() string
func (*CSVWorkLoader) FinishPlanReplayerDump ¶ added in v1.0.9
func (c *CSVWorkLoader) FinishPlanReplayerDump() error
func (*CSVWorkLoader) InitThread ¶ added in v1.0.4
func (*CSVWorkLoader) IsPlanReplayerDumpEnabled ¶ added in v1.0.9
func (c *CSVWorkLoader) IsPlanReplayerDumpEnabled() bool
func (*CSVWorkLoader) Name ¶ added in v1.0.4
func (c *CSVWorkLoader) Name() string
func (*CSVWorkLoader) OutputStats ¶ added in v1.0.4
func (c *CSVWorkLoader) OutputStats(_ bool)
OutputStats just do nothing
func (*CSVWorkLoader) Prepare ¶ added in v1.0.4
func (c *CSVWorkLoader) Prepare(ctx context.Context, threadID int) error
func (*CSVWorkLoader) PreparePlanReplayerDump ¶ added in v1.0.9
func (c *CSVWorkLoader) PreparePlanReplayerDump() error
type Config ¶
type Config struct { Driver string DBName string Threads int Parts int PartitionType int Warehouses int UseFK bool Isolation int CheckAll bool NoCheck bool // Weight for NewOrder, Payment, OrderStatus, Delivery, StockLevel. // Should be int between [0, 100) and sums to 100. Weight []int // whether to involve wait times(keying time&thinking time) Wait bool MaxMeasureLatency time.Duration // for prepare sub-command only OutputType string OutputDir string SpecifiedTables string // connection, retry count when commiting statement fails, default 0 PrepareRetryCount int PrepareRetryInterval time.Duration // output style OutputStyle 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) FinishPlanReplayerDump ¶ added in v1.0.9
func (w *Workloader) FinishPlanReplayerDump() error
func (*Workloader) InitThread ¶
InitThread implements Workloader interface
func (*Workloader) IsPlanReplayerDumpEnabled ¶ added in v1.0.9
func (w *Workloader) IsPlanReplayerDumpEnabled() bool
func (*Workloader) OutputStats ¶ added in v1.0.4
func (w *Workloader) OutputStats(ifSummaryReport bool)
func (*Workloader) Prepare ¶
func (w *Workloader) Prepare(ctx context.Context, threadID int) error
Prepare implements Workloader interface
func (*Workloader) PreparePlanReplayerDump ¶ added in v1.0.9
func (w *Workloader) PreparePlanReplayerDump() error
Click to show internal directories.
Click to hide internal directories.