perf(flights): stop the tracker writing 690 log lines every half hour - #307
perf(flights): stop the tracker writing 690 log lines every half hour#307ChuckBuilds wants to merge 1 commit into
Conversation
The flight tracker logged two unconditional INFO lines on every poll -- one naming the aircraft count it was about to process, one summarising the result. Polls run about every five seconds, so on a live rig that was 686 lines per half hour, roughly 86% of the device's entire log volume, and a steady trickle of journal writes to the SD card for a line that mostly repeated itself. The "Processing N aircraft" line is trace: the summary immediately below reports the same total. Demoted to debug, with lazy %-args so a disabled level costs nothing to skip. The summary is worth keeping, so it is now reported when it changes. Which fields to key on mattered more than expected. Total and With-position jitter on almost every poll as distant traffic drifts through the receiver's edge, and keying on the whole line collapsed 343 samples to 210 -- barely worth doing. Keying on what the plugin actually displays, aircraft in range and aircraft tracked, collapses the same samples to 67. The jittery counts still ride along in the message, where they cost nothing. A 300-second heartbeat keeps a quiet sky from looking like a stalled tracker. Measured by replaying 343 real polls captured from a running rig through the committed logic: 686 lines become 67, a 90% reduction, with the heartbeat never needing to fire. Safety harness passes at all eight sizes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01STMbQE4YctTacQXfbYqKuW
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Up to standards ✅🟢 Issues
|
|
Merge order for the three open flights PRs, test-merged onto main rather than reasoned about:
The step that needs care is #305. It claims 1.12.14, the same version #304 publishes, so resolving that conflict by taking either side leaves two different builds sharing one version and the store never offers the update. It needs a real re-bump to 1.12.15 — this is the one place where "take theirs" gives a wrong answer that looks right. For the others, resolve by taking the higher version and then running Verified on the fully merged tree: all three changes present (vegas width hint, debug-image gate, log throttle), final version 1.12.16, safety harness 8 pass, 0 fail. |
|
Superseded by #314, which combines the four ledmatrix-flights PRs into one version bump. Every change from this PR is verified present on that branch; the branch here is untouched if you want to compare. |
The measurement
On a running rig,
ledmatrix-flightsproduced 686 of ~800 log lines in 30 minutes — 86% of the device's entire log volume, two unconditional INFO lines per poll at roughly one poll every 5 seconds. Every line is a journal write to the SD card, for a message that mostly repeats itself.What changed
Processing N aircraft from SkyAwareis trace — the summary immediately below reports the same total. Demoted todebug, with lazy%-args so a disabled level costs nothing.The summary is worth keeping, so it now logs when it changes, with a 300-second heartbeat so a quiet sky doesn't look like a stalled tracker.
Which fields to key on mattered more than expected
My first attempt keyed on the whole summary line and barely helped.
TotalandWith positionjitter on nearly every poll as distant traffic drifts through the edge of the receiver's range:(in range, tracking)So it keys on what the plugin actually displays. The jittery counts still ride along in the message, where they cost nothing.
Verification
Replayed the 343 real polls captured from the rig through the committed logic:
The heartbeat never fired, so it is a true fallback rather than the thing doing the work.
Safety harness passes at all eight sizes (the
fill warns are pre-existing and unrelated — the harness has no live SkyAware data, so it renders the no-data state).Version
Bumped to 1.12.16, skipping past 1.12.14/1.12.15 so this is independent of merge order with #304 and #305 (both of which claim 1.12.14, so whichever lands second still needs a re-bump).