Skip to content

Commit

Permalink
timing
Browse files Browse the repository at this point in the history
  • Loading branch information
sigurdp committed Nov 22, 2024
1 parent 9fbebf3 commit 6dcb8c7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions backend_py/primary/primary/routers/surface/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 6dcb8c7

Please sign in to comment.