Last active
April 7, 2020 22:17
-
-
Save jayboss222/8742dbb101b2d914b0d5305c416b56a7 to your computer and use it in GitHub Desktop.
Load testing scripts
This file contains hidden or 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, 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