bookshop

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultUserCount   = 10000
	DefaultAuthorCount = 20000
	DefaultBookCount   = 20000
	DefaultOrderCount  = 300000
	DefaultRatingCount = 300000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DBName      string
	DropTables  bool
	UserCount   int
	AuthorCount int
	BookCount   int
	OrderCount  int
	RatingCount int
}

Config is the configuration for book demo workload.

type Workloader

type Workloader struct {
	// contains filtered or unexported fields
}

Workloader is book demo workload.

func NewWorkloader

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

func (*Workloader) Cleanup

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

func (*Workloader) CleanupThread

func (w *Workloader) CleanupThread(ctx context.Context)

CleanupThread implements Workloader interface.

func (*Workloader) DBName

func (w *Workloader) DBName() string

func (*Workloader) InitThread

func (w *Workloader) InitThread(ctx context.Context) context.Context

InitThread inits thread.

func (*Workloader) Name

func (w *Workloader) Name() string

func (*Workloader) Prepare

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

Prepare implements Workloader interface.

func (*Workloader) Run

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

Jump to

Keyboard shortcuts

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