Documentation
¶
Index ¶
- Constants
- type Config
- type Workloader
- func (w *Workloader) Cleanup(ctx context.Context) error
- func (w *Workloader) CleanupThread(ctx context.Context)
- func (w *Workloader) DBName() string
- func (w *Workloader) InitThread(ctx context.Context) context.Context
- func (w *Workloader) Name() string
- func (w *Workloader) Prepare(ctx context.Context) error
- func (w *Workloader) Run(ctx context.Context) error
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) 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
Click to show internal directories.
Click to hide internal directories.