Where I need to initiate, for example, a connection to a physical device, once during a multi user scenario then never again. So many virtual users will be utilizing this one connection.
I could I suppose code this manually but if there’s a better way I’m all ears.
The problem with all of these is that you can’t share network connections between VUs, only data, and that’s only with the first 2 options… Can you elaborate on your use case, what are you trying to do exactly. Because if you’re truly trying to share a network connection, probably the only way to do that now is to write an extension with xk6:
The physical devices needs to be registered once and to have the security tokens available for multiple iterations. In this scenario the device registration is essentially the same as a user logging in.
Easiest way would probably be to set a boolean variable to true indicating whether the device is registered or not and if it is it’s skipped in subsequent iterations.
We’ve also considered registering the devices in the the setup section and storing the tokens in an in memory data store such as redis but we are still looking into redis as a concept for K6.