Skip to content

Instantly share code, notes, and snippets.

@chetth
Created May 11, 2016 06:07
Show Gist options
  • Save chetth/96e77326c4deff2c73ba92cf660888be to your computer and use it in GitHub Desktop.
Save chetth/96e77326c4deff2c73ba92cf660888be to your computer and use it in GitHub Desktop.
Example load testing tool file.
import random
from locust import HttpLocust, TaskSet, task
class WebsiteTasks(TaskSet):
@task(1)
def index(self):
with open("url_list", "r") as listdoc:
urls = listdoc.read().splitlines()
#url = random.choice(urls)
for url in urls:
self.client.get(url)
class WebsiteUser(HttpLocust):
task_set = WebsiteTasks
min_wait = 5000
max_wait = 15000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment