Skip to content

Commit

Permalink
✨ Add locust test
Browse files Browse the repository at this point in the history
add locust test
  • Loading branch information
ekzm8523 committed Nov 16, 2022
1 parent fd21101 commit 2c1635c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
29 changes: 29 additions & 0 deletions locustfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from locust import HttpUser, TaskSet, between, task


class UserAction(TaskSet):
@task
def get_integrate_predict(self):
self.client.post(
"/integrate_predict",
json={
"problem_id": 1234,
"user_answer": "얄라얄라얄라숑 얄라리얄라 얄라얄라얄라숑 얄라리얄라 얄라얄라얄라숑 얄라리얄라 얄라얄라얄라숑 얄라리얄라 얄라얄라얄라숑 얄라리얄라 얄라얄라얄라숑 얄라리얄라",
"keyword_standards": [
{"id": 96, "content": "keyword-1"},
{"id": 97, "content": "keyword-2"},
{"id": 98, "content": "keyword-3"},
],
"content_standards": [
{"id": 123, "content": "content 1"},
{"id": 124, "content": "content 2"},
{"id": 125, "content": "content 3"},
],
},
)


class WebsiteUser(HttpUser):
host = "http://csbroker.ddns.net:2222"
tasks = [UserAction]
wait_time = between(1, 4)
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ mecab-python3==1.0.5
JPype1==1.4.0
ray==2.0.1
pyrootutils==1.0.4
locust==2.13.0

0 comments on commit 2c1635c

Please sign in to comment.