Created
February 22, 2018 00:49
-
-
Save msabramo/dcbdf9fb707c15a3307ebb7eee672cbf to your computer and use it in GitHub Desktop.
A sample 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 | |
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