Created
May 11, 2016 06:07
-
-
Save chetth/96e77326c4deff2c73ba92cf660888be to your computer and use it in GitHub Desktop.
Example load testing tool file.
This file contains hidden or 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 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