“target” parameter

What does the “target” parameter mean in stages?

stages: [
  {duration: "10m", target: 10},
  {duration: "10m", target: 20},
  {duration: "10m", target: 30}

I apologize for the dumb question, but I did not find the information in the documentation.

@AlexSMiheev It’s the target number of Virtual Users that k6 will ramp up or down to during that specific duration. In this case, k6 will ramp to 10 VUs over 10m, to 20 total over the next 10m (adding 10 new), then to 30 over the last 10 minutes before the test stops.

Some other things to note:

  • Virtual Users are concurrent, so they will continuously execute the default function until the test is over. The 30 total VUs here will like likely produce hundreds or thousands of sessions/requests. It depends on how large your default function is, use of sleep(), etc.
  • Ramping is linear in the above stages. VUs come on evenly during the duration.

It’s buried in all the options, but more info is available here: Options reference