You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix(services): cut idle CPU churn and per-request log spam (#84)
* fix(autopilot-manager): back off MAVLink reconnect when no heartbeat
With no flight controller attached, udpin:14571 never receives a heartbeat, so the message loop tore down and recreated the UDP socket every ~3s and logged a WARNING each cycle (~29k journal lines/day plus constant socket churn). Log the disconnect once per episode, probe at 1 Hz, and rebuild the link on a capped exponential backoff (1->30s) -- skipped entirely for a udpin/udp listener, which has no peer to reconnect to.
* perf(service-manager): collect unit states in one systemctl call
get_service_statuses() spawned 'systemctl is-enabled' + 'is-active' per manifested service; the UI polls /statuses at up to 1 Hz, i.e. ~22 process launches/second. Query every unit's UnitFileState/ActiveState in a single 'systemctl show' call instead (37ms vs 131ms on a Pi 5, 1 spawn vs 22). Also route the per-call print()s through a level-gated logger so the polled /statuses and /logs no longer flood the journal.
* fix(ark-ui-backend): stop double-logging every proxied request
Each request was logged twice -- morgan('dev') plus a custom console.log middleware -- with all four proxies at logLevel 'debug', making the gateway the top journal producer on an idle device. Log only 4xx/5xx via morgan, drop the redundant middleware, and lower the proxies to 'warn'. Also remove the body-logging middleware, which printed raw request bodies including WiFi PSKs.
* perf(system-manager): sample psutil memory/disk once per /info
get_common_info() called psutil.virtual_memory() and disk_usage('/') four times each per /info request; sample each once and reuse.