diff --git a/backend_py/primary/primary/routers/surface/router.py b/backend_py/primary/primary/routers/surface/router.py index 385798bd4..6e618c57b 100644 --- a/backend_py/primary/primary/routers/surface/router.py +++ b/backend_py/primary/primary/routers/surface/router.py @@ -352,11 +352,16 @@ def compute_hash(numbers: List[int]) -> str: cached_data = await redis_client.get(my_cache_key) perf_metrics.record_lap("cache-lookup") + response_perf_metrics.record_lap("cache-lookup") + if cached_data: LOGGER.info(f"!!!!!!!!!!!!!!!!!!!!Returning CACHED result in: {perf_metrics.to_string()}") - response_perf_metrics.record_lap("func-total-cached") - return ta.validate_json(cached_data) + ret_val = ta.validate_json(cached_data) + response_perf_metrics.record_lap("cache-parse") + + response_perf_metrics.record_elapsed("func-total-cached") + return ret_val sumo_access_token = authenticated_user.get_sumo_access_token() perf_metrics.record_lap("get-access-token") @@ -392,7 +397,7 @@ def compute_hash(numbers: List[int]) -> str: LOGGER.info(f"Sampled surface in points in: {perf_metrics.to_string()}") - response_perf_metrics.record_lap("func-total-uncached") + response_perf_metrics.record_elapsed("func-total-uncached") return intersections