부하 테스트(locust)

hyuckhoon.ko·2021년 6월 20일
0

What I learned in first year

목록 보기
83/146
post-thumbnail
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

0개의 댓글