local

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecutionScheduler

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

ExecutionScheduler is the local implementation of libWorker.ExecutionScheduler

func NewExecutionScheduler

func NewExecutionScheduler(trs *libWorker.TestRunState) (*ExecutionScheduler, error)

NewExecutionScheduler creates and returns a new local libWorker.ExecutionScheduler instance, without initializing it beyond the bare minimum. Specifically, it creates the needed executor instances and a lot of state placeholders, but it doesn't initialize the executors and it doesn't initialize or run VUs.

func (*ExecutionScheduler) GetExecutionPlan

func (e *ExecutionScheduler) GetExecutionPlan() []libWorker.ExecutionStep

GetExecutionPlan is a helper method so users of the local execution scheduler don't have to calculate the execution plan again.

func (*ExecutionScheduler) GetExecutorConfigs

func (e *ExecutionScheduler) GetExecutorConfigs() []libWorker.ExecutorConfig

GetExecutorConfigs returns the slice of all executor configs, sorted by their (startTime, name) in an ascending order.

func (*ExecutionScheduler) GetExecutors

func (e *ExecutionScheduler) GetExecutors() []libWorker.Executor

GetExecutors returns the slice of configured executor instances which have work, sorted by their (startTime, name) in an ascending order.

func (*ExecutionScheduler) GetInitProgressBar

func (e *ExecutionScheduler) GetInitProgressBar() *pb.ProgressBar

GetInitProgressBar returns the progress bar associated with the Init function. After the Init is done, it is "hijacked" to display real-time execution statistics as a text bar.

func (*ExecutionScheduler) GetRunner

func (e *ExecutionScheduler) GetRunner() libWorker.Runner

GetRunner returns the wrapped libWorker.Runner instance.

func (*ExecutionScheduler) GetState

GetState returns a pointer to the execution state struct for the local execution scheduler. It's guaranteed to be initialized and present, though see the documentation in lib/execution.go for caveats about its usage. The most important one is that none of the methods beyond the pause-related ones should be used for synchronization.

func (*ExecutionScheduler) Init

func (e *ExecutionScheduler) Init(ctx context.Context, samplesOut chan<- workerMetrics.SampleContainer, workerInfo *libWorker.WorkerInfo) error

Init concurrently initializes all of the planned VUs and then sequentially initializes all of the configured executors.

func (*ExecutionScheduler) Run

func (e *ExecutionScheduler) Run(globalCtx, runCtx context.Context, engineOut chan<- workerMetrics.SampleContainer, workerInfo *libWorker.WorkerInfo) error

Run the ExecutionScheduler, funneling all generated metric samples through the supplied out channel.

func (*ExecutionScheduler) SetPaused

func (e *ExecutionScheduler) SetPaused(pause bool) error

SetPaused pauses a test, if called with true. And if called with false, tries to start/resume it. See the libWorker.ExecutionScheduler interface documentation of the methods for the various caveats about its usage.

Jump to

Keyboard shortcuts

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