Documentation
¶
Overview ¶
Package runner provides runner implementations for running testcases at load.
Index ¶
- type DelegateRunner
- func (r *DelegateRunner) Closed() bool
- func (r *DelegateRunner) Closing() bool
- func (r *DelegateRunner) Execute(work loadtest.TestContext) error
- func (r *DelegateRunner) GetHighWaterMark() int
- func (r *DelegateRunner) GetMaxInProgress() int
- func (r *DelegateRunner) GetName() string
- func (r *DelegateRunner) GetRemainingCount() *int
- func (r *DelegateRunner) GetResults() []loadtest.Result
- func (r *DelegateRunner) GetStats() loadtest.Stat
- func (r *DelegateRunner) GetTargetBHCA() int
- func (r *DelegateRunner) GetThrottled() int
- func (r *DelegateRunner) GetWork() *loadtest.TestContext
- func (r *DelegateRunner) Run(next []loadtest.DelegateRunner)
- func (r *DelegateRunner) Running() bool
- func (r *DelegateRunner) Wait() []loadtest.Result
- func (r *DelegateRunner) WorkRemaining() bool
- type InitialRunner
- func (r *InitialRunner) Closed() bool
- func (r *InitialRunner) Closing() bool
- func (r *InitialRunner) GetHighWaterMark() int
- func (r *InitialRunner) GetMaxInProgress() int
- func (r *InitialRunner) GetName() string
- func (r *InitialRunner) GetResults() []loadtest.Result
- func (r *InitialRunner) GetStats() loadtest.Stat
- func (r *InitialRunner) GetTargetBHCA() int
- func (r *InitialRunner) GetThrottled() int
- func (r *InitialRunner) Run(next []loadtest.DelegateRunner)
- func (r *InitialRunner) Running() bool
- func (r *InitialRunner) Wait() []loadtest.Result
- type WorkProvider
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 ¶
GetResults can be used to retrieve the results, after Wait() has completed calling prior to this will panic
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 ¶
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 ¶
GetResults can be used to retrieve the results, after Wait() has completed calling prior to this will panic
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
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