Setup
formatting...Module contains step implementations that configures the load test scenario with parameters applicable for all scenarios.
Configuration value
Step to set configuration variables not present in specified environment file.
The configuration value can then be used in the following steps. If the specified name
already exists, it will be
overwritten.
Example
Given value for configuration "default.host" is "example.com"
...
Then log message "default.host=$conf::default.host$"
Arguments
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
dot separated name/path of configuration value |
required |
value
|
str
|
configuration value, any |
required |
Log level
Message type callback
Register a custom callback function for a custom message type, that should be sent from client/server to client/server (exclusive).
Given register callback "steps.custom.my_custom_callback" for message type "custom_msg" from client to server
Arguments
Name | Type | Description | Default |
---|---|---|---|
callback_name
|
str
|
full namespace and method name to the callback function |
required |
message_type
|
str
|
unique name of the message |
required |
from_node
|
MessageDirection
|
server or client, exclusive |
required |
to_node
|
MessageDirection
|
client or server, exclusive |
required |
Run time
Configure the time period a headless test should run for.
If available test data is infinite, the test will run forever if this step is not used.
Example
Arguments
Name | Type | Description | Default |
---|---|---|---|
timespan
|
str
|
description of how long the test should run for, e.g. 10s, 1h, 40m etc. |
required |
Save statistics
Set an URL where locust statistics should be sent.
It has support for InfluxDB and Azure Application Insights endpoints.
For InfluxDB the following format must be used:
influxdb://[<username>:<password>@]<hostname>[:<port>]/<database>?TargetEnviroment=<target environment>[&Testplan=<test plan>]
[&TargetEnvironment=<target environment>][&ProfileName=<profile name>][&Description=<description>]
For Azure Application Insights the following format must be used:
insights://?InstrumentationKey=<instrumentation key>&IngestionEndpoint=<ingestion endpoint>[&Testplan=<test plan>]
insights://<ingestion endpoint>/?InstrumentationKey=<instrumentation key>[&Testplan=<test plan>]
Example
And save statistics to "influxdb://grizzly:secret-password@influx.example.com/grizzly-statistics"
And save statistics to "insights://?IngestionEndpoint=https://insights.example.com&Testplan=grizzly-statistics&InstrumentationKey=asdfasdfasdf="
And save statistics to "insights://insights.example.com/?Testplan=grizzly-statistics&InstrumentationKey=asdfasdfasdf="
And save statistics to "influxdb://$conf::statistics.username$:$conf::statistics.password$@influx.example.com/$conf::statistics.database$"
Arguments
Name | Type | Description | Default |
---|---|---|---|
url
|
str
|
URL for statistics endpoint |
required |
Wait spawning complete indefinitely
Wait spawning complete timeout
Step to make scenarios wait with execution of tasks until spawning is complete, at most timeout
seconds.
This is when there are dependencies between scenarios. This will make all scenarios to wait until all defined users are spawned.
Example
Arguments
Name | Type | Description | Default |
---|---|---|---|
timeout
|
float
|
number of seconds to wait until locust spawning is complete |
required |