Repository navigation
Health samples: send them apart, at most one a window - #162
Merged
Merged
Conversation
…r a quoted number changes A Mate under strain published every 2 s sample whole, so an I/O stall sent fresh CPU windows, memory and disk numbers nobody reads, and HQ relayed each. The warning quotes numbers only for CPU (the measured window and its top process, to two decimals), so the Mate now publishes again when the warning changes or one of those quoted numbers does. cpuWarningQuote is the one place the copy and the publish rule read the quote from.
… asks HQ relayed every health sample inside the Mate's whole attention record, so a strained Mate's 2 s samples resent its overview each time: 3.7 KB a sample on the structure socket in the 2026-10-09 recording. An attention scope may now ask for health apart; HQ then keeps the record and the health as two values of the scope, so a sample changes only the health value and the record goes out when it changes. The two shapes are separate journals of one scope key. A reader that does not ask, and an HQ from before (which passes the key by), keep the record whole, health inside.
…Q's attention scope The relayed Mate subscribes with health apart and reads health from its own value; from an HQ that does not take it apart it still reads health inside the record. The record's families pass the health value by.
In the 2026-10-09 run 3 Milo sat at its memory limit and the kernel woke the health reader on every memory event, so samples left at up to 33 a second. The Mate now publishes the first sample at once and then at most one per 2 s window, the latest, and only one that says something new.
…atest An older Mate at its memory limit sends a sample on every kernel wake (up to 33 a second in the 2026-10-09 run 3), and HQ relayed each to every reader. Each link now relays the first sample at once and then at most one per 2 s, the latest; its reports run one at a time, the relay beside the frames it reads.
fxck
added a commit
that referenced
this pull request
Oct 9, 2026
- #162 Health samples: send them apart, at most one a window
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Health samples from a strained Mate flooded the client's HQ structure socket. In run 1 two projects each sent a 3.7 KB
attentionframe every 2 s. In run 3 Milo, at its memory limit, sent up to 33 frames a second at about 5 KB each (11.7 KB/s on average). There were three causes:apps/server/src/zerops/mateResourceHealth.ts): while strained, thechangesWithkey was the whole sample. Every changed number got published, and the reader woke on every memory event.cpuWarningQuotein contracts, shared with the copy).latestAtMostEvery).apps/hq/src/hqScopes.ts, attention branch ofload): every sample resent the Mate's whole record, overview included. An attention scope can now ask forhealth: "apart". HQ then keeps the record andhealthas two values in that scope: a sample changes onlyhealth, and the record is resent only when it changes.apps/hq/src/link.ts): HQ relays at most one sample per link per 2 s window, the latest. This also protects readers from Mates that predate this change.Version tolerance
hqScopeKey) ignores the new field, so a client reads either HQ's answer.mateHealthfamily reads it from either shape.Deploy order: HQ first (
pack-core, deploy), then the hosted client, then a Mate release. Any order is safe; the savings arrive with each part.Measured. Test world: a running Core, a Mate link and two reader sockets of one person, with a recorded I/O-strained sample sent at 33/s for 20 s, scaled to a minute.
The Mate rule, replayed on run 1's recorded series: the I/O-strained project sent 274 samples in 9.1 min and would now send 1. The other project would send 4 instead of 103.
Tests (new sentences; no title changed):
link.test.ts: "sends each health sample to a reader that takes health apart as that sample alone, never the Mate's unchanged record again" (an older reader beside it still gets the whole record), and "relays at most one health sample a window from a Mate that sends many, the latest".hq.test.ts: "asks HQ for a Mate's health apart and reads it from that value, or from the whole record of an HQ that sends it inside". Three tests that pin the subscription now expecthealth: "apart".Gates
src/zerops2759;gate-changedfails only on the scenario "history does not paint through the composer footer". It also fails intermittently on the base code, with both variants failing alone.🤖 Generated with Claude Code