Skip to main content

Module preflight

Module preflight 

Source
Expand description

Pre-flight latency probe for sizing --vus against --rps.

Issue #79 round 8 — Srikanth’s reply on 0.3.137 flagged that the --vus * 10 < --rps warning’s “1 VU sustains ~10 req/s at 100ms latency” rule of thumb is wrong for fast targets (~2ms). At 2ms response time, one VU can drive ~500 req/s, so --vus 5 is enough for --rps 1000 but the static rule incorrectly warns “bump to –vus 100”.

Instead, do a tiny (1-3 request) HTTP probe of the actual target to measure baseline latency, then derive a more accurate “VUs needed to sustain rate” estimate. Skip the warning entirely if the measured rate comfortably covers the requested rate.

Structs§

ProbeResult
Result of a pre-flight latency probe.

Functions§

probe_target_latency
Probe target with up to samples quick HEAD/GET requests and report the average successful-response latency. Each probe has a 5s timeout; failed probes are excluded from the average. Returns None if no probe succeeded.