From e75a0ed8e4b6d9187a10f6ff4356a568b857bd8d Mon Sep 17 00:00:00 2001 From: Sigurd Pettersen Date: Fri, 22 Nov 2024 09:11:32 +0100 Subject: [PATCH] Instrumenting surface query service --- .../surface_query_service/surface_query_service.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend_py/primary/primary/services/surface_query_service/surface_query_service.py b/backend_py/primary/primary/services/surface_query_service/surface_query_service.py index 4841ac36c..38a9c4f1b 100644 --- a/backend_py/primary/primary/services/surface_query_service/surface_query_service.py +++ b/backend_py/primary/primary/services/surface_query_service/surface_query_service.py @@ -82,9 +82,14 @@ async def batch_sample_surface_in_points_async( yCoords=y_coords, ) + json_request_body = request_body.model_dump() + async with httpx.AsyncClient(timeout=300) as client: LOGGER.info(f"Running async go point sampling for surface: {surface_name}") - response: httpx.Response = await client.post(url=SERVICE_ENDPOINT, json=request_body.model_dump()) + + perf_metrics.record_lap("prepare_call") + + response: httpx.Response = await client.post(url=SERVICE_ENDPOINT, json=json_request_body) perf_metrics.record_lap("main-call")