No results for

Powered byAlgolia

Constant VUs

suggest edits

Description

A fixed number of VUs execute as many iterations as possible for a specified amount of time. This executor is equivalent to the global vus and duration options.

Options

In addition to the common configuration options this executor also adds the following options:

OptionTypeDescriptionDefault
duration*stringTotal scenario duration (excluding gracefulStop).-
vusintegerNumber of VUs to run concurrently.1

When to use

Use this executor if you need a specific amount of VUs to run for a certain amount of time.

Example

In this example, we'll run 10 VUs constantly for a duration 45 minutes.

constant-vus.js
1import http from 'k6/http';
3export let options = {
4 discardResponseBodies: true,
5 scenarios: {
6 my_awesome_api_test: {
7 executor: 'constant-vus',
8 vus: 10,
9 duration: '45m',
10 },
11 },
12};
14export default function () {
15 http.get('https://test-api.k6.io/');
16 sleep(Math.random() * 3);
17}