您的位置:首页 > 其它

locust load test

2015-12-20 22:02 519 查看
from
locust import
HttpLocust, TaskSet, task

"""

http://docs.locust.io/en/latest/

locust -f  ./demolocust.py --host=http://docs.locust.io
"""
class UserBehavior(TaskSet):

def on_start(self):
""" on_start is called when a Locust start before any task is scheduled """
self.index()

def index(self):
self.client.get("/")

@task(2)
def quickstart(self):
self.client.get("/en/latest/quickstart.html")

@task(1)
def api(self):
self.client.get("/en/latest/api.html")

class WebsiteUser(HttpLocust):
task_set = UserBehavior
min_wait=5000
max_wait=9000
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: