Skip to main content

Module polling

Module polling 

Source
Expand description

The idle poll interval, and what the daemon measured its polling cost.

Two small records, one in each direction:

  • config/polling.toml holds the idle poll interval (host set-poll-interval --idle). The active interval is the existing hosts.refresh_interval_secs column. The idle one lives in a file rather than a new column on purpose: a schema step makes the database refuse to open under an older build, and a polling preference is not worth making a downgrade impossible on every host it reaches. An absent file is the default.
  • state/poll-traffic.toml is written by the daemon and read by status, host show and host doctor. They run in the operator’s terminal and the daemon runs in a service, so the measurement has to be on disk, like github-contact.toml beside it.

Structs§

PollTraffic
What one daemon measured about its own polling, host-wide.

Constants§

SETTINGS_FILE
The idle-interval setting, inside config/.
TRAFFIC_FILE
The daemon’s measurement, inside state/.

Functions§

idle_interval
The configured idle interval, or the default when none was set.
last_traffic
The daemon’s last measurement, or None when no daemon has written one.
record_traffic
Write the measurement.
set_idle_interval
Store the idle interval.