You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have developed a custom client and would like to use the host variable that can be passed on the command line when starting locust when instantiating my custom class
locust --host=http://example.com -f locustfile.py
I have interrogated the Locust object in my custom class without success.
I have the same need but I cannot find a way to retrieve the host option. I checked main.py but apparently the options object is not stored in a location I can access from my TaskSet.
OK I found a solution. If you are subclassing Locust then you can access host using self.host.
If you are subclassing a TaskSet then you can access host using self.parent.host.
Hi,
I have developed a custom client and would like to use the
host
variable that can be passed on the command line when starting locust when instantiating my custom classI have interrogated the Locust object in my custom class without success.
I can see that the
options.host
argument is set in theLocustRunner
class, but we don't seem to have access to this in the Locust file?Any tips on where I should be looking would be gratefully received!
Thanks!
The text was updated successfully, but these errors were encountered: