runner

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package runner provides runner implementations for running testcases at load.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DelegateRunner

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

DelegateRunner accepts work into a work queue via the Execute and ExecuteMulti methods. Work will be queue until the runner is started via the Run method and continued to be accepted until the point the Wait method is closed, at which point no further work is accepted All work is performed in strict first in first out basis according to bhca and max simultaneous parameters

func NewDelegateRunner

func NewDelegateRunner(name string, testCase loadtest.Test, maxInProgress int, bhca int) *DelegateRunner

NewDelegateRunner creates a new delegate runner

func (*DelegateRunner) Closed

func (r *DelegateRunner) Closed() bool

Closed is true after Run() and Wait() have both completed

func (*DelegateRunner) Closing

func (r *DelegateRunner) Closing() bool

Closing is true if Wait() has been called but has not yet completed

func (*DelegateRunner) Execute

func (r *DelegateRunner) Execute(work loadtest.TestContext) error

Execute accepts a single work item for execution An error is returned if the Wait has been called on the executor

func (*DelegateRunner) GetHighWaterMark

func (r *DelegateRunner) GetHighWaterMark() int

GetHighWaterMark is used to retrieve the maximum number of tests in progress at any point in time panics if called prior to completion

func (*DelegateRunner) GetMaxInProgress

func (r *DelegateRunner) GetMaxInProgress() int

GetMaxInProgress returns the configured max in progress calls which, if 0, means unlimited

func (*DelegateRunner) GetName

func (r *DelegateRunner) GetName() string

GetName returns runner name

func (*DelegateRunner) GetRemainingCount added in v0.0.4

func (r *DelegateRunner) GetRemainingCount() *int

func (*DelegateRunner) GetResults

func (r *DelegateRunner) GetResults() []loadtest.Result

GetResults can be used to retrieve the results, after Wait() has completed calling prior to this will panic

func (*DelegateRunner) GetStats

func (r *DelegateRunner) GetStats() loadtest.Stat

GetStats returns current opreational stats, used by monitoring

func (*DelegateRunner) GetTargetBHCA

func (r *DelegateRunner) GetTargetBHCA() int

GetTargetBHCA returns the configured target BHCA

func (*DelegateRunner) GetThrottled

func (r *DelegateRunner) GetThrottled() int

GetThrottled returns the number of calls that were delayed due to reaching maximum in progress limit

func (*DelegateRunner) GetWork added in v0.0.4

func (r *DelegateRunner) GetWork() *loadtest.TestContext

func (*DelegateRunner) Run

func (r *DelegateRunner) Run(next []loadtest.DelegateRunner)

Run will start the runner

func (*DelegateRunner) Running

func (r *DelegateRunner) Running() bool

Running is true if the Run() and either Wait() has not been called or has not yet completed

func (*DelegateRunner) Wait

func (r *DelegateRunner) Wait() []loadtest.Result

Wait must be called only once, and after Run has been called It will block until the runner completes and return the results

func (*DelegateRunner) WorkRemaining added in v0.0.4

func (r *DelegateRunner) WorkRemaining() bool

type InitialRunner

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

InitialRunner is typically used at the head of a test chain to start and meter out initial work It will run for a fixed number of iterations at the bhca and max in progress limits specified Each test run will have no test context, however, if you need to use some methodology to set different values for the individual tests, you can do so in the test itself (with proper synchronization) optionally using the Init method of an InitializedTest to bootstrap parameters

func NewInitialRunner

func NewInitialRunner(name string, testCase loadtest.Test, maxInProgress int, bhca int, iterations int) *InitialRunner

NewInitialRunner creats a new initial runner

func (*InitialRunner) Closed

func (r *InitialRunner) Closed() bool

Closed is true after Run() and Wait() have both completed

func (*InitialRunner) Closing

func (r *InitialRunner) Closing() bool

Closing is true if Wait() has been called but has not yet completed

func (*InitialRunner) GetHighWaterMark

func (r *InitialRunner) GetHighWaterMark() int

GetHighWaterMark is used to retrieve the maximum number of tests in progress at any point in time panics if called prior to completion

func (*InitialRunner) GetMaxInProgress

func (r *InitialRunner) GetMaxInProgress() int

GetMaxInProgress returns the configured max in progress calls which, if 0, means unlimited

func (*InitialRunner) GetName

func (r *InitialRunner) GetName() string

GetName returns runner name

func (*InitialRunner) GetResults

func (r *InitialRunner) GetResults() []loadtest.Result

GetResults can be used to retrieve the results, after Wait() has completed calling prior to this will panic

func (*InitialRunner) GetStats

func (r *InitialRunner) GetStats() loadtest.Stat

GetStats returns current opreational stats, used by monitoring

func (*InitialRunner) GetTargetBHCA

func (r *InitialRunner) GetTargetBHCA() int

GetTargetBHCA returns the configured target BHCA

func (*InitialRunner) GetThrottled

func (r *InitialRunner) GetThrottled() int

GetThrottled returns the number of calls that were delayed due to reaching maximum in progress limit

func (*InitialRunner) Run

func (r *InitialRunner) Run(next []loadtest.DelegateRunner)

Run will start the runner

func (*InitialRunner) Running

func (r *InitialRunner) Running() bool

Running is true if the Run() and either Wait() has not been called or has not yet completed

func (*InitialRunner) Wait

func (r *InitialRunner) Wait() []loadtest.Result

Wait must be called only once, and after Run has been called It will block until the runner completes and return the results

type WorkProvider

type WorkProvider interface {
	// WorkReamining must return true if there is no more work to do
	WorkRemaining() bool

	// GetWork must provide the next work item, or nil if there is no more work to do
	GetWork() *loadtest.TestContext

	// Remaining should provide the remaining (un-started) test count, if known
	// if not known, nil
	GetRemainingCount() *int
}

WorkProvider is used to provide work to a runner

Jump to

Keyboard shortcuts

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