Skip to content

Commit

Permalink
log more
Browse files Browse the repository at this point in the history
  • Loading branch information
HansKallekleiv committed Nov 29, 2023
1 parent 6dff0b4 commit af48191
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions backend/src/backend/user_session/routers/surface/test_go.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,20 @@ def go_get_surface_blobs(sumo_token: str, case_uuid: str, object_ids: list[str])
}
elapsed_init = timer.lap_ms()
res = GetZippedBlobs(json.dumps(new_request).encode("utf-8"))

elapsed_get = timer.lap_ms()
res_string = ctypes.string_at(res).decode("ascii")
size_bytes = len(res_string)
size_mb = size_bytes / (1024 * 1024)
data_map_b64 = json.loads(res_string)
elapsed_decode = timer.lap_ms()
LOGGER.info(
f"Downloaded surfaces with Go: {timer.elapsed_ms()}ms",
extra={"init": elapsed_init, "get": elapsed_get, "decode": elapsed_decode},
f"Downloaded surfaces with Go: {timer.elapsed_ms()}ms ("
f"init go and query sumo={elapsed_init}ms, "
f"get={elapsed_get}ms, "
f"decode={elapsed_decode}ms, "
f"size_mb={size_mb:.2f}) ",
extra={"init": elapsed_init, "get": elapsed_get, "decode": elapsed_decode, "size_mb": size_mb},
)
return data_map_b64
for object_id, b64_blob in data_map_b64.items():
Expand Down

0 comments on commit af48191

Please sign in to comment.