workload

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2025 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TpcState

type TpcState struct {
	DB   *sql.DB
	Conn *sql.Conn

	R *rand.Rand

	Buf *util.BufAllocator
}

TpcState saves state for each thread

func NewTpcState

func NewTpcState(ctx context.Context, db *sql.DB) *TpcState

NewTpcState creates a base TpcState

func (*TpcState) RefreshConn added in v1.0.6

func (t *TpcState) RefreshConn(ctx context.Context) error

type Workloader

type Workloader interface {
	Name() string
	InitThread(ctx context.Context, threadID int) context.Context
	CleanupThread(ctx context.Context, threadID int)
	Prepare(ctx context.Context, threadID int) error
	CheckPrepare(ctx context.Context, threadID int) error
	Run(ctx context.Context, threadID int) error
	Cleanup(ctx context.Context, threadID int) error
	Check(ctx context.Context, threadID int) error
	OutputStats(ifSummaryReport bool)
	DBName() string

	IsPlanReplayerDumpEnabled() bool
	PreparePlanReplayerDump() error
	FinishPlanReplayerDump() error
	Exec(sql string) error
}

Workloader is the interface for running customized workload

Jump to

Keyboard shortcuts

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