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=''

  

相关文章:

  • 2021-08-09
  • 2021-06-12
  • 2021-06-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-16
  • 2022-12-23
  • 2021-05-16
  • 2021-10-28
  • 2021-11-26
  • 2021-10-19
  • 2021-12-02
相关资源
相似解决方案