Best Python code snippet using locust
extra-EXAMPLES-multiple_hosts.py
Source:extra-EXAMPLES-multiple_hosts.py
...14 def index(self):15 self.locust.client.get("/")16 17 @task18 def index_other_host(self):19 self.locust.api_client.get("/stats/requests")20 21class WebsiteUser(MultipleHostsLocust):22 """23 Locust user class that does requests to the locust web server running on localhost24 """25 host = "http://127.0.0.1:8089"26 min_wait = 200027 max_wait = 5000...
multiple_hosts.py
Source:multiple_hosts.py
...11 @task12 def index(self):13 self.user.client.get("/")14 @task15 def index_other_host(self):16 self.user.api_client.get("/stats/requests")17class WebsiteUser(MultipleHostsUser):18 """19 User class that does requests to the locust web server running on localhost20 """21 host = "http://127.0.0.1:8089"22 wait_time = between(2, 5)...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!