Skip to content
This repository has been archived by the owner on Oct 4, 2022. It is now read-only.

Commit

Permalink
add initial locustfile for load testing
Browse files Browse the repository at this point in the history
  • Loading branch information
alee committed Feb 13, 2015
1 parent 52951ad commit 1095121
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
30 changes: 30 additions & 0 deletions vcweb/experiment/lighterprints/locustfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from locust import HttpLocust, TaskSet, task

import logging

logger = logging.getLogger(__name__)

number_of_users = 500
usernames = ['s%dasu@mailinator.com' % n for n in xrange(0, number_of_users)]


class LighterprintsTaskSet(TaskSet):

def on_start(self):
if len(usernames) > 0:
username = usernames.pop()
self.login(username)

def login(self, username):
self.client.post("/accounts/login/", {"username": username, "password": "test"})

@task
def participate(self):
self.client.get("/participate")


class VcwebUser(HttpLocust):
host = "http://localhost:8000"
task_set = LighterprintsTaskSet
min_wait = 5000
max_wait = 60000
2 changes: 0 additions & 2 deletions vcweb/sockjs-redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
from tornadoredis import pubsub




sys.path.append(path.abspath(path.join(path.dirname(path.abspath(__file__)), '..')))
os.environ['DJANGO_SETTINGS_MODULE'] = 'vcweb.settings'

Expand Down

0 comments on commit 1095121

Please sign in to comment.