Quantcast
Channel: Grafana k6 - Grafana Labs Community Forums
Viewing all articles
Browse latest Browse all 406

Sequential Data Assignment for VUs in constant-vus Executor

$
0
0

I’m working on a load test scenario in K6 where I need each Virtual User (VU) to process unique data from a CSV file. Here’s what I’ve tried so far:

export const options = {
scenarios: {
functionName: {
executor: “constant-vus”,
exec: “functionName”,
duration: “5s”,
vus: 3, // Number of VUs
},
},
thresholds: {
http_req_duration: [“p(95)<500”],
},
};

let data = itemData[__VU - 1].code;

However, with this setup, I’m noticing that the same data (the first row of the CSV) is being used by all VUs. I want each VU to read a unique row from the dataset so that VU1 gets the first row, VU2 gets the second row, and so on.

Questions:

  1. How can I configure K6 with the constant-vus executor to ensure each VU uses unique data?
  2. Is there a specific executor better suited for this use case?

Any insights or examples would be greatly appreciated! Thank you in advance!

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 406

Trending Articles