ch

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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWorkloader

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

NewWorkloader new work loader

Types

type Config

type Config struct {
	Driver             string
	DBName             string
	RawQueries         string
	QueryNames         []string
	TiFlashReplica     int
	AnalyzeTable       analyzeConfig
	ExecExplainAnalyze bool
	RefreshConnWait    time.Duration

	EnablePlanReplayer bool
	PlanReplayerConfig replayer.PlanReplayerConfig

	// output style
	OutputStyle string
}

Config is the configuration for ch workload

type Workloader

type Workloader struct {
	PlanReplayerRunner *replayer.PlanReplayerRunner
	// contains filtered or unexported fields
}

Workloader is CH workload

func (*Workloader) Check

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

Check checks data

func (*Workloader) CheckPrepare

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

CheckPrepare checks prepare

func (*Workloader) Cleanup

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

Cleanup cleans up workloader

func (*Workloader) CleanupThread

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

CleanupThread cleans up thread

func (*Workloader) DBName

func (w *Workloader) DBName() string

DBName returns the name of test db.

func (*Workloader) Exec added in v1.0.10

func (w *Workloader) Exec(sql string) error

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 inits thread

func (*Workloader) IsPlanReplayerDumpEnabled added in v1.0.9

func (w *Workloader) IsPlanReplayerDumpEnabled() bool

func (*Workloader) Name

func (w *Workloader) Name() string

Name return workloader name

func (*Workloader) OutputStats

func (w *Workloader) OutputStats(ifSummaryReport bool)

func (*Workloader) Prepare

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

Prepare prepares data

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 runs workload

Jump to

Keyboard shortcuts

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