From fb9b6dbb2202ab2ec8662afc5fac6de29a85ce03 Mon Sep 17 00:00:00 2001 From: badbl0cks <4161747+badbl0cks@users.noreply.github.com> Date: Sat, 19 Apr 2025 17:11:19 -0700 Subject: [PATCH] add locust load testing --- locustfile.py | 18 ++++++++++++++++++ requirements.txt | 2 ++ 2 files changed, 20 insertions(+) create mode 100644 locustfile.py diff --git a/locustfile.py b/locustfile.py new file mode 100644 index 0000000..042280a --- /dev/null +++ b/locustfile.py @@ -0,0 +1,18 @@ +import time +from locust import HttpUser, task, between + +class QuickstartUser(HttpUser): + wait_time = between(1, 5) + + @task + def healthcheck_get(self): + self.client.get("/health") + + # @task + # def view_cards(self): + # for item_id in range(22): + # self.client.get(f"/cards/?page={item_id}", name="/cards/") + # time.sleep(1) + + # def on_start(self): + # self.client.post("/login", json={"username":"foo", "password":"bar"}) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index d83527e..7d7259e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,7 +18,9 @@ django-meta==2.4.2 django-silk==5.3.1 django-tailwind-4[reload]==0.1.4 django-widget-tweaks==1.5.0 +gevent==25.4.1 gunicorn==23.0.0 +granian==2.2.5 idna==3.4 imgkit==1.2.3 oauthlib==3.2.2