125):
126 """Make a single HTTP request and record results."""
127 url = f"http://{config.host}:{config.port}/"
128
129 try:
130 start_time = time.perf_counter()
131 response = client.get(url, timeout=config.timeout)
132 elapsed_ms = (time.perf_counter() - start_time) * 1000
133
134 if response.status_code == 200:
135 results.record_success(elapsed_ms)
136 else:
137 results.record_failure("http_error")
138
139 except httpx.ConnectError:
140 results.record_failure("connection")
141 except httpx.TimeoutException:
142 results.record_failure("timeout")
143 except KeyboardInterrupt:
144 _thread.interrupt_main()
145 except Exception:
146 results.record_failure("other")
147
148