Skip to content

User

formatting...

Module contains step implementations that describes a load user.

Type

Set which type of load user the scenario should use and which host is the target.

Example

Given a user of type "RestApi" load testing "http://api.example.com"
Given a user of type "MessageQueue" load testing "mq://mqm:secret@mq.example.com/?QueueManager=QMGR01&Channel=Channel01"
Given a user of type "ServiceBus" load testing "sb://sb.example.com/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=abc123def456ghi789="
Given a user of type "BlobStorage" load testing "DefaultEndpointsProtocol=https;EndpointSuffix=core.windows.net;AccountName=examplestorage;AccountKey=xxxyyyyzzz=="

Arguments

Name Type Description Default
user_class_name str

name of an implementation of load user, with or without User-suffix

required
host str

an URL for the target host, format depends on which load user is specified

required

Type with count

Set which type of load user the scenario should use, which host is the target and how many users that should be spawned.

Example

Given "1" user of type "RestApi" load testing "..."
Given "10" users of type "MessageQueue" load testing "..."
Given "5" users of type "ServiceBus" load testing "..."
Given "1" user of type "BlobStorage" load testing "..."

Arguments

Name Type Description Default
user_count int

number of users locust should create

required
user_class_name str

name of an implementation of load user, with or without User-suffix

required
host str

an URL for the target host, format depends on which load user is specified

required

Type with count and tag

Set which type of load user the scenario should use, which host is the target, how many users that should be spawned and an associated tag.

Users with the same tag value will run on the same set of workers, which will be exclusive for users with the same tag value.

Example

Given "1" user of type "RestApi" with tag "foo" load testing "..."
Given "10" users of type "MessageQueue" with tag "foo" load testing "..."
Given "5" users of type "ServiceBus" with tag "bar" load testing "..."
Given "1" user of type "BlobStorage" with tag "bar" load testing "..."

Arguments

Name Type Description Default
user_count int

number of users locust should create

required
user_class_name str

name of an implementation of load user, with or without User-suffix

required
tag str

unique string to "stick" user types to a set of exclusive workers

required
host str

URL for the target host, format depends on which load user is specified

required

Type with weight

Set which type of load user the scenario should use and which host is the target, together with weight of the user (how many instances of this user should spawn relative to others).

Example

Given a user of type "RestApi" with weight "2" load testing "..."
Given a user of type "MessageQueue" with weight "1" load testing "..."
Given a user of type "ServiceBus" with weight "1" load testing "..."
Given a user of type "BlobStorage" with weight "4" load testing "..."

Arguments

Name Type Description Default
user_class_name str

name of an implementation of load user, with or without User-suffix

required
weight_value str

weight value for the user, default is 1 (see writing a locustfile)

required
host str

an URL for the target host, format depends on which load user is specified

required