Read the census after the first write, and every 90 minutes #131
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/census-first-read"
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?
What this PR does
Two changes to when the
censusplugin reads the census:poll_hoursoption (whole hours, default 4) becomespoll_minutes(default 90, allowed 60–1440).1. The first read.
The first read was scheduled 1–10 minutes after the census started, and the first write 5–30 minutes in, so a device usually read before it had reported. Its own entry then didn't show on its card or page until the next read, about
poll_hours(4 by default) later. Now a device that reports, and hasn't written yet that UTC day, reads only after its first write has been checked (the write time, plus the check's 60 s, plus 1–10 minutes). That applies at start-up, after a pause and at midnight. A device that already wrote that day, or one withreportoff, reads on the usual schedule.2. 90-minute reads. An entry stays in its slot 60–120 minutes after its device's last write, because writers keep only this hour's and last hour's entries. A 4-hour read, and even a 2-hour one with its ±10% jitter, misses many devices that were online for only an hour or so, so "active today" undercounts. At 90 minutes nearly all of them are caught. With a small census that's about 4.2 MB a day (16 reads), against the 5 MB default
daily_mb; reads cost more as slots fill. Renaming the option is safe now: no release has shipped it, and the census has noconfig.tomltable.census.py:_plan_read; thepoll_minutesoption, with its help text and the 60–1440 clamp.poll_minutes, and to expect the next read about 90 minutes on.docs/user-guide/census-setup.mdandGUIDE_MD: the first read's timing,poll_minutes, and data use of about 4 MB a day while the census is small.Checklist
make lint(ansible--syntax-check,yamllint,shellcheck --severity=error, and the real-data check). The Lint workflow runs this on the PR.make test(thekestrel_pipytest suite and the real-data check's tests). The Test workflow runs this on the PR..envfiles, real names, personal emails, device serials, and no real captured or device data: SSIDs, MAC addresses, GPS coordinates, capture files, diagnostics bundles, logs, or screenshots of a real device — placeholders only. The real-data check catches MACs, emails, keys and capture files; real SSIDs, coordinates and screenshots are on you.docs/, and the on-device operator guide (GUIDE_MDinkestrel_pi/userguide.py) where it applies.Release impact
kestrel_pipackage,plugins/*.py, systemd units, the journald drop-in, a lib script already in the engine'sLIB_SCRIPTS, or the CLI.config.txt/cmdline, kernel modules, the base image or partition size,builder/config.json,builder/config.yml, theMakefile,.forgejo/workflows/, a shipped config default (config.toml/default.conf), or a brand-new lib script.Notes for review
Both came up while planning the beta test. With one device, the first card and page would have shown zero Kestrels for about four hours. Then the 90-minute default, after weighing data use against the 60–120-minute lifetime of an entry.
🤖 Generated with Claude Code
Read the census after the first writeto Read the census after the first write, and every 90 minutes