Locust: Difference between revisions
Jump to navigation
Jump to search
Line 12: | Line 12: | ||
mkdir -p ~/Documents/locust-playground | mkdir -p ~/Documents/locust-playground | ||
cd ~/Documents/locust-playground | cd ~/Documents/locust-playground | ||
locust | |||
open http://localhost:8089 &>/dev/null | |||
</source> | </source> | ||
| valign="top" | | | valign="top" | | ||
<source lang="bash"> | |||
cat <<'EOF' > ~/Documents/locust-playground/test-urlencoded-data.py | |||
from locust import HttpUser, task | |||
class HelloWorldUser(HttpUser): | |||
@task | |||
def hello_world(self): | |||
self.client.get("/services/audit/health") | |||
self.client.get("/services/quote/health") | |||
EOF | |||
</source> | |||
|- | |- |
Revision as of 18:53, 20 January 2024
python3 -m venv ~/.venv/locust --prompt="Locust"
source ~/.venv/locust/bin/activate
pip install locust
locust -V
Playground
mkdir -p ~/Documents/locust-playground
cd ~/Documents/locust-playground
locust
open http://localhost:8089 &>/dev/null
|
cat <<'EOF' > ~/Documents/locust-playground/test-urlencoded-data.py
from locust import HttpUser, task
class HelloWorldUser(HttpUser):
@task
def hello_world(self):
self.client.get("/services/audit/health")
self.client.get("/services/quote/health")
EOF
|
| |
References
| ||
| ||