feat(warmup): per-module canary records (thread + timing observability)
Adds a canary record for each module submitted to the warmup, tracking: canary_id, module, thread_name, thread_id, submit_ts, start_ts, end_ts, elapsed_ms, status, error. Surface: - WarmupManager.canaries() returns list[dict] (defensive copy) - AppController.warmup_canaries() returns list[dict] (delegation) - GET /api/warmup_canaries Hook API endpoint - ApiHookClient.get_warmup_canaries() returns list[dict] Example: the warmup of google.genai records a 1187ms canary on thread controller-io_0 with thread_id 50420, canary_id 1. 11 new tests (8 unit in test_warmup_canaries + 3 in test_api_hooks_warmup). All pass; live_gui smoke test confirms endpoint returns real data.
This commit is contained in:
@@ -318,6 +318,17 @@ class ApiHookClient:
|
||||
"""
|
||||
return self._make_request('GET', f'/api/warmup_wait?timeout={timeout}') or {}
|
||||
|
||||
def get_warmup_canaries(self) -> list[dict[str, Any]]:
|
||||
"""
|
||||
Returns per-module import canary records: list of dicts with
|
||||
canary_id, module, thread_name, thread_id, submit_ts, start_ts,
|
||||
end_ts, elapsed_ms, status, error. Used for debugging which
|
||||
worker thread loaded which module and how long it took.
|
||||
[C: tests/test_api_hooks_warmup.py:test_get_warmup_canaries_in_live_gui]
|
||||
"""
|
||||
result = self._make_request('GET', '/api/warmup_canaries') or {}
|
||||
return result.get("canaries", []) if isinstance(result, dict) else []
|
||||
|
||||
#endregion: Diagnostics
|
||||
|
||||
#region: Project
|
||||
|
||||
Reference in New Issue
Block a user