Start one balancer, three workers, and one load generator:
docker compose up --buildService URLs:
- Balancer API: http://127.0.0.1:8000/docs
- Generator API: http://127.0.0.1:8200/docs
Workers are internal compose services and register themselves in the balancer:
worker-1: weight1, cost rate1.0worker-2: weight2, cost rate1.2worker-3: weight1, cost rate0.8
Generate one request through the generator:
Invoke-RestMethod `
-Method Post `
-Uri http://127.0.0.1:8200/traffic/once `
-ContentType application/json `
-Body '{"profile":"mixed"}'Start background traffic:
Invoke-RestMethod `
-Method Post `
-Uri http://127.0.0.1:8200/traffic/start `
-ContentType application/json `
-Body '{"profile":"mixed","rate_per_second":5,"total_requests":100}'Check stats:
Invoke-RestMethod http://127.0.0.1:8000/stats
Invoke-RestMethod http://127.0.0.1:8200/statsStop services:
docker compose down