Inserting Ids generated by individual VUs to an array

Hi,

I am trying to do the following:

  1. VU’s are extracting Ids of interest from the database record
  2. I want the Ids from individual VUs to be pushed to an array
  3. I want to do further operations on the array with Ids

What is the most appropriate way of handling this in k6?

Regards,
Gavin

Hi @gavindelatour

If I understand your question correctly, your predominant need is to share the state between VUs. We know that limitation and are trying to address it soon, but there is no ETA so far.

As the workaround, you could use the xk6-redis extension (obviously, for that you need some redis instance) redis | Grafana k6 documentation. There, you can store and fetch data within VU context.

Hope that helps.

Cheers!