locust
原创
©著作权归作者所有:来自51CTO博客作者wx5b6d6c951e615的原创作品,请联系作者获取转载授权,否则将追究法律责任
locust
from locust import HttpLocust,TaskSet,task
class UserVue(TaskSet):
#tasks = {buy:1,consume:2} #设置权重
def login(self):
self.client.post('/login.do',{"user":"admin","pwd":"123456"})
def on_start(self):
self.login()
def on_stop(self):
pass
@task(1)
def buy(self):
self.client('/exeInterface',{"id":100,"job":"15666625"})
@task(2)
def consume(self):
self.client.post('/cdpipeline-server/consumer',{"id":22.,"jonName":"job_1444"})
class WebsiteUser(HttpLocust):
task_set = UserVue
min_wait = 200
max_wait = 8000 # ms
stop_timeout = 20 #s
host=''