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(required)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';
2import { sleep } from 'k6';
3
4export const options = {
5 discardResponseBodies: true,
6 scenarios: {
7 my_awesome_api_test: {
8 executor: 'constant-vus',
9 vus: 10,
10 duration: '45m',
11 },
12 },
13};
14
15export default function () {
16 http.get('https://test-api.k6.io/');
17 sleep(Math.random() * 3);
18}