VUs / iteration task assignment
Hello,
I have a list / array of 10 points, how can I assign these 10 points to an iteration if there are several VUs?
How can I distribute these 10 points over the iterations
import { sleep } from 'k6';
export const options = {
vus: 3,
iterations: 10,
};
export default function () {
console.log(`VU: ${__VU} - ITER: ${__ITER}`);
if (__VU === 1) {
sleep(1);
};
}
Report
INFO[0000] VU: 1 - ITER: 0 source=console
INFO[0000] VU: 2 - ITER: 0 source=console
INFO[0000] VU: 2 - ITER: 1 source=console
INFO[0000] VU: 2 - ITER: 2 source=console
INFO[0000] VU: 2 - ITER: 3 source=console
INFO[0000] VU: 2 - ITER: 4 source=console
INFO[0000] VU: 2 - ITER: 5 source=console
INFO[0000] VU: 3 - ITER: 0 source=console
INFO[0000] VU: 3 - ITER: 1 source=console
INFO[0000] VU: 3 - ITER: 2 source=console