"""Load test for f1api's /ask: point it at a real, running `uvicorn f1api.main:app`.

    uv run locust -f locustfile.py --host http://127.0.0.1:8000

then open http://localhost:8089, pick a user count and spawn rate, and watch the p95: it should
track `acquire_delay` closely below the pool's `max_size` concurrent users, then climb once
demand passes it — the whole point of sizing a pool instead of guessing at one.
"""

from locust import HttpUser, between, task


class AskUser(HttpUser):
    wait_time = between(0.1, 0.5)

    @task
    def ask(self) -> None:
        self.client.post("/ask", json={"prompt": "how many connections are in the pool?"})

    @task(3)
    def healthz(self) -> None:
        self.client.get("/healthz")
