feat(api): GET /api/stats HUD counters (counts only, never 500) #42
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "osint-dashboard/t_75d2037f-osint-get-api-stats-hud-counters"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds
GET /api/stats— a cheap counts-only endpoint (~100 B–2 KB) for the layer rail, so the HUD can poll counters without pulling megabytes of GeoJSON.Returns:
How it works
aircraftandvesselsfrom the existingaircraft_last_known/vessel_last_knowndicts;trainsandalertsfrom new last-known counters (train_count,nws_alert_count) that the Amtraker and NWS fetchers already update on their normal cadence.cameras,fires(FIRMS table), andquakes(eventswheresource_type='earthquake') viaSELECT count(*).0; the rail still renders.Cache-Control: max-age=15), GZip already on the app.Tests
tests/test_api_stats.py— 6 tests: 200 + all keys present, all counters are ints, timestamp is ISO8601-Z, payload < 2 KB, last-known counters reflected, and DB failure degrades to zero.Out of scope
Leaflet rail wiring, new ingest, CelesTrak, camera parsers.