Write a CLI script that accepts a list of API endpoints (via a text file or command-line arguments) and, for each one, runs 100 sequential requests, records per-request latency, and outputs a formatted table showing p50, p95, p99, max, and request count per endpoint. If the response includes a Server-Timing header, parse and display each named phase alongside the total. The script must accept a --threshold flag (default 500ms); any endpoint whose p99 exceeds the threshold is highlighted as a warning.
,, then split each entry on ; and parse the dur= token with a regex or simple string split.rich.table for the output table — it handles alignment and colour with minimal code.text/tabwriter for aligned columns.Benchmarking 3 endpoints (n=100 each)...
Endpoint p50 p95 p99 max n
─────────────────────────────────────────────────────────────────────────
https://jsonplaceholder.typicode.com/posts 82ms 110ms 145ms 230ms 100
https://jsonplaceholder.typicode.com/posts/1 45ms 62ms 89ms 140ms 100
https://httpbin.org/get 92ms 130ms 160ms 280ms 100
Server-Timing breakdown (where present):
https://YOUR_SERVER/api db=42ms auth=3ms cache=miss
--concurrency N flag that fires N requests in parallel (not sequentially) and recomputes the distribution under load.# per request).