Uptime Monitor
Background thread pings the portfolio API and site every 60 seconds, recording response times. This page graphs the last 24 hours of data : pulled live from the server.
Live Dashboard
Auto-refreshes every 30 seconds. Chart shows response time in ms over 24 hours.
How it works
Decisions
A daemon thread in the same process is simpler than a separate cron job. It dies with the app : no orphan processes, no separate deployment step.
24 hours of 1-minute checks is ≈1440 entries per target : trivially small. A JSON file avoids a database dependency and is easy to inspect manually.
Chart.js or D3 would be overkill for a single line chart. Drawing directly on Canvas keeps the page at zero dependencies.
Writes go to a temp file first, then os.replace() swaps atomically.
Prevents corrupted reads if the API serves during a write.