-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added distributive load tests and docker support
- Loading branch information
1 parent
cf8122e
commit 24ad9f5
Showing
7 changed files
with
49 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from __future__ import annotations | ||
|
||
from loadtests.locustfile import LocustRunner | ||
|
||
__all__ = ["LocustRunner"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
from __future__ import annotations | ||
|
||
from locust import HttpUser | ||
from locust import constant | ||
from locust import task | ||
from locust import TaskSet | ||
|
||
|
||
class Home(HttpUser): | ||
class Home(TaskSet): | ||
wait_time = constant(1) | ||
|
||
@task | ||
def home_endpoint(self): | ||
self.client.get("/api/home/") | ||
|
||
@task | ||
def stop(self): | ||
self.interrupt() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from __future__ import annotations | ||
|
||
from home import Home | ||
from locust import HttpUser | ||
|
||
|
||
class LocustRunner(HttpUser): | ||
tasks = [Home] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
locustfile = ./loadtests | ||
headless = false | ||
master = false | ||
expect-workers = 5 | ||
host = http://0.0.0.0:8000 | ||
users = 10 | ||
spawn-rate = 10 | ||
run-time = 3m | ||
tags = [Critical, Normal] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
echo "Running load tests" | ||
echo | ||
locust -f loadtests --headless --users 10 --spawn-rate 1 -t 2m -H http://0.0.0.0:8000 | ||
locust |