from locust import HttpUser, between, task
class WebsiteUser(HttpUser):
wait_time = between(5, 15)
# def on_start(self):
# self.client.post("/login", {
# "username": "test_user",
# "password": ""
# })
@task
def index(self):
self.client.get("/")
# self.client.get("/static/assets.js")
@task
def about(self):
self.client.get("/shop/product/2395")
if __name__ == "__main__":
from locust.env import Environment
my_env = Environment(user_classes=[WebsiteUser])
WebsiteUser(my_env).run()
출처: https://stackoverflow.com/questions/64503974/cant-run-locust-in-debug-mode