tpcc

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: Apache-2.0 Imports: 18 Imported by: 2

Documentation

Index

Constants

View Source
const (
	PartitionTypeHash = iota + 1
	PartitionTypeRange
	PartitionTypeListAsHash
	PartitionTypeListAsRange
)

Variables

This section is empty.

Functions

func NewWorkloader

func NewWorkloader(db *sql.DB, cfg *Config) (workload.Workloader, error)

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 (c *CSVWorkLoader) InitThread(ctx context.Context, threadID int) context.Context

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

func (*CSVWorkLoader) Run added in v1.0.4

func (c *CSVWorkLoader) Run(_ context.Context, _ int) error

CSV type doesn't support Run

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

func (w *Workloader) InitThread(ctx context.Context, threadID int) context.Context

InitThread implements Workloader interface

func (*Workloader) IsPlanReplayerDumpEnabled added in v1.0.9

func (w *Workloader) IsPlanReplayerDumpEnabled() bool

func (*Workloader) Name

func (w *Workloader) Name() string

Name implements Workloader interface

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

func (*Workloader) Run

func (w *Workloader) Run(ctx context.Context, threadID int) error

Run implements Workloader interface

Jump to

Keyboard shortcuts

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