Private
Public Access
0
0
Files
manual_slop/src
ed 5a85653654 feat(startup_profiler): add StartupProfiler for per-phase init timing
Lightweight, in-memory profiler for AppController init phases. Used by
the startup_speedup_20260606 track to measure where the time goes
during boot (config hydration, hook server start, subsystem init, etc.).

The profiler is exposed via /api/startup_profile (Phase 8 work) and
the Diagnostics panel so the user can see the exact per-phase cost.

Public API:
  StartupProfiler() - create
  .phase(name) - context manager
  .snapshot() - {phases: {name: {start_ts, duration_ms}}, total_ms, count}
  .reset() - clear recorded phases
  .enable() / .disable() - toggle recording

Implementation:
  - dataclass with list of _Phase(name, start_ts, end_ts)
  - @contextmanager records wall-clock via time.perf_counter
  - records duration even if the body raises (try/finally)
  - snapshot is a copy, so consumers can't mutate the live state

TDD: 5 tests in tests/test_startup_profiler.py cover: basic
recording, total math, snapshot isolation, exception safety, empty
state.
2026-06-06 13:57:26 -04:00
..
2026-06-05 22:34:26 -04:00
2026-06-06 12:44:07 -04:00
2026-06-06 10:24:22 -04:00
2026-06-06 10:24:22 -04:00
2026-06-06 10:24:22 -04:00
2026-06-06 10:24:22 -04:00
2026-06-06 10:24:22 -04:00
2026-06-06 10:24:22 -04:00
2026-06-06 00:40:07 -04:00
2026-06-06 00:40:07 -04:00
2026-06-06 10:24:22 -04:00
2026-06-06 10:24:22 -04:00
2026-06-06 10:24:22 -04:00
2026-06-06 10:24:22 -04:00
2026-06-06 01:05:00 -04:00
2026-06-06 10:24:22 -04:00
2026-06-06 10:24:22 -04:00
2026-06-06 10:24:22 -04:00
2026-06-06 10:24:22 -04:00
2026-06-06 10:24:22 -04:00
2026-06-06 10:24:22 -04:00
2026-06-06 10:24:22 -04:00
2026-06-06 11:08:07 -04:00
2026-06-06 11:08:07 -04:00
2026-06-06 11:08:07 -04:00
2026-06-06 11:08:07 -04:00
2026-06-06 11:08:07 -04:00
2026-06-06 11:08:07 -04:00
2026-06-06 11:08:07 -04:00
2026-06-06 11:08:07 -04:00