I'm new to locust and I'm trying to write load tests. I was wondering what is the difference between defining the tasks I want to do as callable functions rather then defining them as locust TaskSet classes. for example:
class MyTaskSet(TaskSet):
@task(2)
def index(self):
self.client.get("/")
@task(1)
def about(self):
self.client.get("/about/")
class MyLocust(HttpLocust):
task_set = MyTaskSet
or:
class about(TaskSet)
@task
def about(self):
self.client.get("/about/")
self.interrupter()
class index(TaskSet)
@task
def index(self)
self.client.get("/")
self.interrupter()
class MyTaskSet(TaskSet)
tasks = {index:2 , about: 1}
class MyLocust(HttpLocust):
task_set = MyTaskSet
what is the difference between the 2 above? thanks