Documentation
¶
Overview ¶
Command waitload blocks until the host is quiet enough to measure on, and exits 0 only then: the 1-minute load average at or below a limit, and with --max-busy the CPU busy share too, for K consecutive readings.
⛔ WHY THIS EXISTS. An agent must not measure on a busy host (1-minute load above about 8), and no fleet program could WAIT for a quiet one: hostload reads the load once and exits 1, and the shell loop or `sleep` an agent would reach for is refused by guard-bash. An agent stopped on exactly that at 21:42 CET on 2026-11-18.
⛔ IT READS THE LOAD THROUGH loadavg.Avg1 AND THE BUSY SHARE THROUGH internal/procstat, the two readers hostload uses. A second reader would be a second place for the macOS sysctl decoding to be wrong.
⛔ THE LOOP IS BOUNDED BY A COUNT AND BY A DEADLINE, BOTH COMPUTED BEFORE THE FIRST READING (#327): the load is a value the host reports, and no predicate over a reported value is a bound this command controls. The count is the number of readings that fit in --timeout; the deadline is elapsed time.