Skip to content

Commit

Permalink
locustfile
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmuth committed Sep 2, 2017
1 parent 7c1ae9b commit 8a3e194
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
10 changes: 10 additions & 0 deletions locust/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# locust tests

http://locust.io

```bash
sudo apt-get update -y
sudo apt install python-pip -y
sudo pip install locustio
locust --host=http://ec2-34-234-71-187.compute-1.amazonaws.com:8000 --port=8003
```
15 changes: 15 additions & 0 deletions locust/locustfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from locust import HttpLocust, TaskSet

def api(l):
l.client.get("/api")

class UserBehavior(TaskSet):
tasks = {api: 5}

def on_start(self):
login(self)

class WebsiteUser(HttpLocust):
task_set = UserBehavior
min_wait = 5
max_wait = 500

0 comments on commit 8a3e194

Please sign in to comment.