Created
June 21, 2010 22:38
-
-
Save cgbystrom/447635 to your computer and use it in GitHub Desktop.
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
import locust | |
import gevent | |
from clients import HTTPClient | |
from gevent import wsgi | |
# Defines the behaviour of a locust (aka a website user :) | |
def website_user(name): | |
c = HTTPClient('http://localhost:8088') | |
for i in range(0, 10): | |
c.get('/fast', name='Fast page') # Request the fast page | |
gevent.sleep(5) # Think for 5 seconds | |
c.get('/slow', name='Slow page') # Do another request | |
locust.prepare_swarm_from_web(website_user, hatch_rate=5, max=20) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment