Stack the slices of a whole, and dash the lines among them - #32
Merged
Conversation
Memory is not seven independent readings. App, wired, compressed, cached and free are five slices of one machine's RAM, and five lines climbing from zero answer "how big is each part" while hiding the question you opened the card for: how full is the machine. Stacked, the bands answer both. A metric declares whether it is a slice. MetricDescriptor.composition is .part, .aggregate or nil -- the same shape as direction, and for the same reason: it is a fact about the metric, so a source added later gets stacking without anything else being told. CPU turns out to be the same shape as Memory, since total is user plus system exactly. An aggregate must never be a band, and this is what the feature turns on. Memory Used is app plus wired plus compressed, so stacking it counts those three a second time and puts the top of the card at nearly twice the RAM in the machine. It keeps its line instead, landing exactly on the bands it sums. Swap keeps a line too, being on disk rather than in RAM. The claim is held against the real machine rather than a fixture: the slices account for between 85% and 102% of physical RAM, so they cannot overlap, and Used is strictly larger than any one of them. CPU is checked as the exact identity it is. Lines among bands are dashed, with a hollow legend swatch rather than a filled one. A line on a stacked card is a different kind of statement -- a sum of the bands under it, or something not in the whole at all -- and drawn in the same solid stroke the card uses for slices it invites reading as one more slice. A stacked card is bounded by the summed height per timestamp, not by its tallest band: the top of the stack is what the eye reads. Stacked and mirrored are exclusive, by declaration and again in ChartCard, because a band below a baseline would be nonsense however it got there. Closes #24 Claude-Session: https://claude.ai/code/session_01UPbN2SqYq8t2vcx2YWQTcs
4 tasks
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.
Summary
MetricDescriptor.compositionis.part,.aggregateor nil — same shape asdirection, and for the same reason: a fact about the metric, so a source added later gets stacking for free. CPU turned out to be the same shape as Memory, sincecpu.total = (user + system) / totalexactly.nominalMaximumof physical RAM; a stacked group without one would have overflowed the card.ChartCard, because a band below a baseline is nonsense however it got there.Closes #24
Test plan
swift build && swift test— 175 tests in 20 suitesswift build -c releaseswiftformat Sources Tests --lint --cache ignore— cleanswift run monitor: Memory and CPU stack; Used and Total land on top of the bands they sum; the dashed lines and hollow swatches read clearly; Disk and Network are untouched by the settinghttps://claude.ai/code/session_01UPbN2SqYq8t2vcx2YWQTcs