Repository navigation
Replies: 1 comment
|
For transport phases, use the request's from time import perf_counter
def timed_get(client, url):
starts, durations = {}, {}
def trace(name, info):
phase, _, state = name.rpartition(".")
if state == "started":
starts[phase] = perf_counter()
elif state in ("complete", "failed") and phase in starts:
durations.setdefault(phase, []).append(perf_counter() - starts.pop(phase))
response = client.get(url, extensions={"trace": trace})
return response, durationsUse an These are implementation-level event names, such as Validated against a loopback HTTP server, observing TCP connect and response-body events. Trace extension. Validation version: HTTPX 0.28.1, Python 3.11.9. |
Uh oh!
There was an error while loading. Please reload this page.
Is it possible to get more details from repsonse time, like cdn lookup time, request connect time, response bytes read time etc...
All reactions