Agent selection
When creating a test, you can either specify a test agent right away by selecting one from the list or configure selecting the first agent that becomes available. The agent selection function allows you to filter test agents by parameters you set.
Specifying a test agent
To specify a test agent:
-
In the management console
, select the folder for testing. -
In the list of services, select Load Testing.
-
In the
Tests tab, click Create test. -
In the Agents section, click Select from list.
-
Select the name of the agent you need from the drop-down list.
Note
Within a single test, you can assign multiple agents to work synchronously, which allows you to increase the load on the test target.
To do this, either select multiple agent names from the list or use Only and Except buttons in the row with the name of one of the agents. These buttons allow you to select only this agent or all agents other than this one, respectively.
When creating a test, specify agent IDs:
export AGENT_ID1='<agent_1_ID>'
export AGENT_ID2='<agent_2_ID>'
yc loadtesting test create \
--name "yc-examples-test" \
--description "Test has been created using YC" \
--labels source=gh,type=tutorial,kind=multi \
--configuration id=$TEST_CONFIG_ID,agent-id=$AGENT_ID1,test-data=$TEST_PAYLOAD_FILE_IN_CONFIG \
--configuration id=$TEST_CONFIG_ID,agent-id=$AGENT_ID2,test-data=$TEST_PAYLOAD_FILE_IN_CONFIG \
--test-data name=$TEST_PAYLOAD_FILE_IN_CONFIG,s3bucket=$S3_PAYLOAD_BUCKET,s3file=$S3_PAYLOAD_FILENAME
Setting up selection of the first test agent that becomes available
To configure selecting the first test agent that becomes available:
- In the management console
, select the folder for testing. - In the list of services, select Load Testing.
- In the
Tests tab, click Create test. - In the Agents section, click First released.
- If any of the agents is suitable for the test, select Any suitable agent; otherwise, select Set conditions and set up the agent filtering conditions:
- (Optional) In the Filter labels section, click Add label and specify the labels for agent selection in
key:value
format. - (Optional) In the Filter by name field, specify a string that must be present in the names of the agents you want to start the test configuration on.
- (Optional) In the Filter labels section, click Add label and specify the labels for agent selection in
- In the Agent count field, specify how many agents will be used to run the test in synch: This will allow you to increase the load on the test target.
Set the filtering conditions:
export ANY_AGENT_SELECTOR=""
export SPECIFIC_AGENT_SELECTOR="labels.key IN (value1, value2)"
yc loadtesting test create \
--name "yc-examples-test" \
--description "Test has been created using YC" \
--labels source=gh,type=tutorial \
--configuration id=$TEST_CONFIG_ID,agent-by-filter=$ANY_AGENT_SELECTOR,test-data=$TEST_PAYLOAD_FILE_IN_CONFIG \
--configuration id=$TEST_CONFIG_ID,agent-by-filter={$SPECIFIC_AGENT_SELECTOR},test-data=$TEST_PAYLOAD_FILE_IN_CONFIG \
--test-data name=$TEST_PAYLOAD_FILE_IN_CONFIG,s3bucket=$S3_PAYLOAD_BUCKET,s3file=$S3_PAYLOAD_FILENAME
In this example, the first part of the test will be performed on any suitable agent (because no filtering conditions are set in ANY_AGENT_SELECTOR
), while the second part, on any agent with the key
label set to value1
or value2
.