Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct { ExecutionScheduler lib.ExecutionScheduler Options lib.Options Collectors []lib.Collector NoThresholds bool NoSummary bool SummaryExport bool Metrics map[string]*stats.Metric MetricsLock sync.Mutex Samples chan stats.SampleContainer // contains filtered or unexported fields }
The Engine is the beating heart of k6.
func (*Engine) Init ¶
Init is used to initialize the execution scheduler and all metrics processing in the engine. The first is a costly operation, since it initializes all of the planned VUs and could potentially take a long time. It either returns an error immediately, or it returns test run() and wait() functions.
Things to note:
- The first lambda, Run(), synchronously executes the actual load test.
- It can be prematurely aborted by cancelling the runCtx - this won't stop the metrics collection by the Engine.
- Stopping the metrics collection can be done at any time after Run() has returned by cancelling the globalCtx
- The second returned lambda can be used to wait for that process to finish.
Click to show internal directories.
Click to hide internal directories.