Skip to content

Instantly share code, notes, and snippets.

@jayboss222
Last active April 7, 2020 22:17
Show Gist options
  • Save jayboss222/8742dbb101b2d914b0d5305c416b56a7 to your computer and use it in GitHub Desktop.
Save jayboss222/8742dbb101b2d914b0d5305c416b56a7 to your computer and use it in GitHub Desktop.
Load testing scripts
from locust import HttpLocust, TaskSet, task, between
from locust.contrib.fasthttp import FastHttpLocust
def index(l):
l.client.get("/")
def stats(l):
l.client.get("/latency-test")
class UserTasks(TaskSet):
@task
def my_task(self):
print("Locust instance (%r) executing my_task" % (self.locust))
tasks = [index]
# pass
class WebsiteUser(FastHttpLocust):
"""
Locust user class that does requests to the locust web server running on localhost
"""
# host = "https://awsproxy.dev.paybyphoneapis.dev"
wait_time = between(2, 6)
task_set = UserTasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment