Created
July 27, 2022 15:51
-
-
Save sedkis/2d6061743fb6349c0cc21fcb68ebf6b6 to your computer and use it in GitHub Desktop.
locustfile.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from locust import HttpLocust, TaskSet, task | |
def index(l): | |
l.client.get("/") | |
def stats(l): | |
l.client.get("/stats/requests") | |
class UserTasks(TaskSet): | |
# one can specify tasks like this | |
tasks = [index, stats] | |
# but it might be convenient to use the @task decorator | |
@task | |
def page404(self): | |
self.client.get("/hello") | |
class WebsiteUser(HttpLocust): | |
""" | |
Locust user class that does requests to the locust web server running on localhost | |
""" | |
host = "https://so-called-impudence-gw.aws-use1.cloud-ara.tyk.io/v1.0/CVD-Cloud-2/vin/JTEBU5JR8L5813911" | |
min_wait = 2000 | |
max_wait = 5000 | |
task_set = UserTasks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment