We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8d006ef commit 3abf298Copy full SHA for 3abf298
src/stac_auth_proxy/proxy.py
@@ -1,4 +1,5 @@
1
import logging
2
+import time
3
from dataclasses import dataclass
4
from urllib.parse import urlparse
5
@@ -41,10 +42,14 @@ async def passthrough(self, request: Request):
41
42
)
43
logger.debug(f"Proxying request to {rp_req.url}")
44
45
+ start_time = time.perf_counter()
46
rp_resp = await self.client.send(rp_req, stream=True)
47
+ proxy_time = time.perf_counter() - start_time
48
+
49
logger.debug(
- f"Received response status {rp_resp.status_code!r} from {rp_req.url}"
50
+ f"Received response status {rp_resp.status_code!r} from {rp_req.url} in {proxy_time:.3f}s"
51
52
+ rp_resp.headers["X-Upstream-Time"] = f"{proxy_time:.3f}"
53
54
return StreamingResponse(
55
rp_resp.aiter_raw(),
0 commit comments