How to get the value of 'Counter'

how to get the value of ‘Counter’

You can’t get the value of a Counter from inside of the k6 test. Can you share what your use case for doing this is?

image
image
image

Such a case:
I have a json file like picture 1, load this file by using 'SharedArray ', I want get different id for every different vu and iteration like picture 3, how could I correctly use counter ?

Can I get value of counter? Let me know if you have better suggestions, thanks alot.

Hello @jessie !
Maybe this answer will help you

2 Likes

Really thank you for your helpful reply, this answer helps a lot.