Locust: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
No edit summary
Line 13: Line 13:
cd      ~/Documents/locust-playground
cd      ~/Documents/locust-playground
source ~/.venv/locust/bin/activate
source ~/.venv/locust/bin/activate
locust --users 100\
--spawn-rate 10 -H http://academia.local


locust
locust --headless --users 100\
locust --headless --users 100\
  --spawn-rate 10 -H http://academia.local
  --spawn-rate 10 -H http://academia.local
open http://localhost:8089 &>/dev/null &
open http://localhost:8089 &>/dev/null &
</source>
</source>

Revision as of 03:48, 21 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
source ~/.venv/locust/bin/activate
locust --users 100\
 --spawn-rate 10 -H http://academia.local

locust --headless --users 100\
 --spawn-rate 10 -H http://academia.local
open http://localhost:8089 &>/dev/null &
cat <<'EOF' > ~/Documents/locust-playground/locustfile.py
from locust import HttpUser, task

class HealthCheck(HttpUser):
    @task
    def hello_world(self):
        self.client.get("/services/audit/health")
        self.client.get("/services/quote/health")
EOF

knowledge

gnome-open http://localhost:8080 &>/dev/null &
xdg-open http://localhost:8080 &>/dev/null &
sensible-browser http://localhost:8080 &>/dev/null &
x-www-browser http://localhost:8080 &>/dev/null &

References