Skip to content

Instantly share code, notes, and snippets.

@msabramo
Created February 22, 2018 00:49
Show Gist options
  • Save msabramo/dcbdf9fb707c15a3307ebb7eee672cbf to your computer and use it in GitHub Desktop.
Save msabramo/dcbdf9fb707c15a3307ebb7eee672cbf to your computer and use it in GitHub Desktop.
A sample locustfile.py
from locust import HttpLocust, TaskSet, task
class UserBehavior(TaskSet):
# def on_start(self):
# """ on_start is called when a Locust start before any task is scheduled """
# self.login()
@task(2)
def index(self):
self.client.get("/")
@task(2)
def about(self):
self.client.get("/about")
@task(2)
def about_config(self):
self.client.get("/about/config")
@task(2)
def applications(self):
self.client.get("/v2/applications")
@task(2)
def images(self):
self.client.get("/v2/images")
@task(2)
def deployments(self):
self.client.get("/v2/deployments")
class WebsiteUser(HttpLocust):
task_set = UserBehavior
min_wait = 5
max_wait = 9000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment