locustio / locust

Write scalable load tests in plain Python 🚗💨
https://locust.cloud
MIT License
25.06k stars 2.99k forks source link

Is there any approach to share a file among hatched users? #1022

Closed stevenli1217 closed 5 years ago

stevenli1217 commented 5 years ago

I have a series of data set which I use to do performance test. I hope all the hatched user can share this file and read the file one by one. For example, I have users from 1 to n. If thread #1 read the first line of the file, next thread should read the second line of the file.

For Jmeter, we can set "Sharing mode" to "All threads" in "CSV Data Set Config".

aldenpeterson-wf commented 5 years ago

Just write a global function in the locust file itself and have your locusts access it.

Python makes this pretty easy comparatively.

cgoldberg commented 5 years ago

Please ask general questions in the Slack channel.