I need to implement the next logic:
1) Execute on_start method (eg login)
2) Execute the next task (task_2) 5 times
3) After that execute the next task (task_3) 10 times
Return to on_start etc...
So finally I need login:1, task_2: 5, task_3: 10. (5 and 10 times per 1 login)
I try to implement it with the next code:
class MyTaskSet(TaskSequence):
def on_start(self):
login()
@seq_task(1)
def task_2(self):
print('Need to be executed 5 times after 1 login')
@seq_task(2)
def task_3(self):
print('Need to be executed 10 times after 1 login')
class LocustUser(HttpLocust):
host = http://localhost
task_set = MyTaskSet
Could someone of performance guru help me with this logic?