Keep now on the metrics axis while a job is reporting - #4132
Merged
Conversation
now marker on the metrics axis
peterschmidt85
force-pushed
the
metrics-now-bold
branch
from
August 12, 2026 11:47
a64724a to
58f75e5
Compare
now marker on the metrics axisnow on the metrics axis while a job is reporting
peterschmidt85
force-pushed
the
metrics-now-bold
branch
from
August 12, 2026 12:06
58f75e5 to
1434036
Compare
The axis labelled its right edge `now` only when the newest sample was under ten seconds old, borrowing `pretty_date`'s threshold. Collection runs every ten seconds, so samples routinely arrive older than that: polling a live job, three renders in ten showed an absolute time instead, and under `--watch` the edge alternated between the two. Thresholds on three collection intervals instead. A job whose instance goes unreachable still shows its last timestamp -- that gap is minutes, not seconds. Draws `now` bold, in the grey `no data` already uses, so a live run is distinguishable at a glance from one that stopped reporting. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
peterschmidt85
force-pushed
the
metrics-now-bold
branch
from
August 12, 2026 12:07
1434036 to
0fcad27
Compare
Five of the six in this module restated what the function below already said, or argued for the option taken over one that was not. The remaining one records that the server sends samples newest-first, which is a fact from outside this file and draws every chart backwards if missed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`_axis` and `_stamp` said nothing about building a timeline row or formatting a timestamp for it, and `_span` sat next to `_window` meaning two different windows. Names that carry their meaning at the call site beat a docstring that only carries it at the definition: _axis -> _time_axis builds the timeline row _stamp -> _time_label formats one timestamp for it _span -> _shared_window the window all jobs are drawn against _window -> _job_window one job's own first and last sample _lead -> _blank_cells cells to blank before a job started _drawn -> _cells_drawn cells a job actually fills _cell -> _chart_cell a sparkline joined to its number _level_cell -> _capacity_cell memory as a fraction of capacity _latest -> _latest_value Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Renaming alone did not carry it: `_time_axis` still did not say it builds a row, `_time_label` hid that it returns `now` for a live job, and `_samples_num` did not say it takes the longest series. Each now has one line stating what it does. `_chart_cell` is gone -- it wrapped a single `Text.assemble` at three call sites and only added a name to look up. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
On a healthy run the axis showed a timestamp instead of
nowabout a quarter of the time, and alternated between the two under-w— so a job that was fine looked like it kept dying. The check was tighter than the collection interval it was reporting on.nowis also drawn bold, so a live run is distinguishable at a glance from one that stopped reporting.A run whose instance goes unreachable still shows its last timestamp, unchanged.