Hello,
Let’s say I have 10 VU and 5 iterations per VU, how can I share a variable between all the iterations of the same VU ?
The typical use case is to generate the token of each VU on the first iteration (each VU has a différent username). The token will then be stored in a variable that will be read in the following iterations in order to avoid having to generate the token in each iteration.
So it would look like this:
export default function(data) {
var token = getTokenForUser(vu.idInInstance); // I would like to do this only on the first iteration of the VU and not on each iteration
callApiEndpoint();
}
I cannot do it in the setup() method as the token would be the same for all VUs (I want a différent token for each VU).