workload

package
v0.0.0-...-6530c03 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Allocator

type Allocator struct {
	Stage     uint
	StageName string
	TrxSet    *trx.Set             // config.stage.trx
	Workload  []config.ClientGroup // config.stage.workload
	StageQPS  limit.Rate           // config.stage.qps
	StageTPS  limit.Rate           // config.stage.tps
	DoneChan  chan *client.Client  // Stage.doneChan
}

Allocator allocate a workload by using configured client groups (config.ClientGroup) to create runnable client groups (workload.ClientGroup) grouped into execution groups. It has two methods that must be called in order: Groups, then Clients. This is done once for each stage in Stage.Prepare.

Allocator modifies Workload.

func (*Allocator) AutoAssign

func (a *Allocator) AutoAssign() []config.ClientGroup

func (*Allocator) Clients

func (a *Allocator) Clients(groups [][]int, withStats bool) ([][]ClientGroup, error)

func (*Allocator) Groups

func (a *Allocator) Groups() ([][]int, error)

Group is allocation call 1 of 2 that returns a key for Clients to access Stage.Workload.[]ClientGroup.

type ClientGroup

type ClientGroup struct {
	Runtime   time.Duration // used by Stage to create a single ctx for all clients in the group
	DataLimit bool
	Clients   []*client.Client
}

ClientGroup is a runnable group of clients created from a config.ClientGroup. It's the return type of Clients, grouped by the execution groups returned by Groups:

[]config.ClientGroup -> Groups -> Clients -> [][]workload.ClientGroup

Jump to

Keyboard shortcuts

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