I have the next code from locustio documentation:
from locust import HttpLocust, TaskSet, between
def login(l):
l.client.post("/login", {"username":"ellen_key", "password":"education"})
def logout(l):
l.client.post("/logout", {"username":"ellen_key", "password":"education"})
def index(l):
l.client.get("/")
def profile(l):
l.client.get("/profile")
class UserBehavior(TaskSet):
tasks = {index: 2, profile: 1}
def on_start(self):
login(self)
def on_stop(self):
logout(self)
class WebsiteUser(HttpLocust):
task_set = UserBehavior
wait_time = between(5.0, 9.0)
In the locust logs and locust web (localhost:8089) I see the next tasks
- /login
- /logout
- /
- /profile
But what if I need to have few requests in one task and get measure from full tasks (not 1 request).
What I want to see is:
- login
- logout
- index
- profile
I want to see the names of tasks instead of request url. In Jmeter I can insert few request in one action and get action time (not request).