Skip to content

ctop: Give each row a sparkline of its job rate - #1976

Open
leftwo wants to merge 2 commits into
mainfrom
alan/ctop-spark
Open

leftwo wants to merge 2 commits into
mainfrom
alan/ctop-spark

Conversation

@leftwo

@leftwo leftwo commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

The DELTA column says how much work an upstairs has done since the last update, which
does not distinguish one that has been busy for a minute from one that just woke up. Keep
the last hundred deltas per session and graph them in whatever width the columns
leave over.

Every row is scaled against the largest sample on screen rather than its own range, so the
rows can be compared with each other. The cost is that a quiet session next to a busy one
reads as flat, which is the honest answer to "is this one doing anything".

The axis counts samples, not time: a session that stops reporting adds nothing, so its
sparkline keeps its shape rather than growing a gap. This is something to address in a future PR.

@leftwo
leftwo requested a review from jmpesp September 15, 2026 16:51
@leftwo
leftwo added this pull request to stack #1969 September 15, 2026 16:51
@leftwo
leftwo force-pushed the alan/ctop-spark branch 2 times, most recently from 0b08612 to 86d876b Compare September 16, 2026 18:30
Comment thread ctop/src/main.rs
Comment on lines +368 to +370
/// Heights are scaled against `global_max` taken across every session
/// on screen. A busy row looks busier than a quiet one rather than
/// every row filling its own range.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be toggle-able I think, as outliers will basically hide all others.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alternative would be to show each 100 samples (or whatever size, I plan to change that to a longer number and do more in the future) scaled to a single sessions min/max, is that what you would toggle between?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is with the toggle.

First, the new way, where each line has its own relative size:

ctop - Unix timestamp: 1789686244                                                              
     PID  SESSION DS0 DS1 DS2    NEXTJOB DELTA EXTL RECD RECN
     215 6f4b5c51 ACT ACT ACT      76800     0    0    0    0▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▆▂▁▁▁▂▂▁▁▁▁▁
     219 11dd7add ACT ACT ACT     224353     0    0    0    0▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▆▂▁▁▁▂▂▁▁▁▁▁▁▁▁▁▁▁
     219 1e92c6de ACT ACT ACT    2462881     0    0    0    0▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
     219 2577e713 ACT ACT ACT    2036432     0    0    0    0▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
     219 2713071d ACT ACT ACT    2434910     0    0    0    0▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
     219 32364ede ACT ACT ACT    2022742     0    0    0    0▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
     219 aa899cc4 ACT ACT ACT    2434692     0    0    0    0▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
     219 d01a3542 ACT ACT ACT    2462944     0    0    0    0▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
    4423 b1bee2c9 ACT ACT ACT      84319     0    0    0    0▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█▃▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
>   9825 16e00792 ACT ACT ACT     211941     1    0    0    0▁▁▁▁▁▁▁▁▁▁▁█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▂▂
    9857 1c3665ee ACT ACT ACT     204256     1    0    0    0▁▁▅▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█▃
   16567 065a24fe ACT ACT ACT   47492651  2701    0    0    0▆▇▆▇▆▇▆▇▆▇▇▇▇▆▇▆▇▆▇▆▇▆▇▆▇▆▇▆▇▇▇▇▇▇▆▇▆▇▆▇▆▇▆
   16567 22617d36 ACT ACT ACT  111818570  6090    0    0    0▆▇▅▅▅▆▇▅▅▅▅▆▅▇▅▅▆▄▇▅▅▅▅▇▅▅▅▅█▅▅▅▅▇▆▅▅▅▆▆▅▅▅
   16567 2cbf490b ACT ACT ACT   29637003  1822    0    0    0▆▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇
   16567 3cd6ae66 NEW NEW NEW    5809526     0    0    0    0▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
   16567 c626d5c6 ACT ACT ACT   29621532  1942    0    0    0▇▇▇▇▇▇▇▇▇▆▇▇▇▇▇▇▇▇█▇▇▇▇▇▇▇▇▇▇▇▆▇▇▇▇▇▇▇▇▇▆▇▇
   16567 eb32a0db ACT ACT ACT   30129543  1908    0    0    0█▆▆▇▇▆▇▇▇▆▇▇▆▇▇▇▆▇▇▆▇▇▇▇▇▇▆▇▇▇▆▇▇▆▇▇▇▆▇▇▇▇▇


[up/down: Move | 's': Scale | 'q': Quit]  scale: self  * = stale (5s)                            [10/17]

Then, the same(ish) timeframe but with one common scale:

ctop - Unix timestamp: 1789686362                                                             
     PID  SESSION DS0 DS1 DS2    NEXTJOB DELTA EXTL RECD RECN
     215 6f4b5c51 ACT ACT ACT      76806     0    0    0    0▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
     219 11dd7add ACT ACT ACT     224411     0    0    0    0▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
     219 1e92c6de ACT ACT ACT    2462881     0    0    0    0▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
     219 2577e713 ACT ACT ACT    2036432     0    0    0    0▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
     219 2713071d ACT ACT ACT    2434910     0    0    0    0▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
     219 32364ede ACT ACT ACT    2022742     0    0    0    0▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
     219 aa899cc4 ACT ACT ACT    2434692     0    0    0    0▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
     219 d01a3542 ACT ACT ACT    2462944     0    0    0    0▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
>   4423 b1bee2c9 ACT ACT ACT      84331     0    0    0    0▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
    9825 16e00792 ACT ACT ACT     212011     0    0    0    0▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
    9857 1c3665ee ACT ACT ACT     204319     0    0    0    0▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
   16567 065a24fe ACT ACT ACT   47848325  2898    0    0    0▃▃▃▂▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃▃
   16567 22617d36 ACT ACT ACT  112636667  5974    0    0    0▄▇▅▅▇▆▆▅▅▆▅▇▅▅▅▅▇▆▅▅▅▆▆▇▆▅▅▅▆▇▆▅▅▆▇▆▆▅▆▆▆▆▅
   16567 2cbf490b ACT ACT ACT   29840469  1667    0    0    0▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▁▂▂▂▂▂▂▂▂▂
   16567 3cd6ae66 NEW NEW NEW    5809526     0    0    0    0▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
   16567 c626d5c6 ACT ACT ACT   29825243  1666    0    0    0▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂
   16567 eb32a0db ACT ACT ACT   30325929  1323    0    0    0▂▂▂▂▂▂▂▁▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▁▂▂▂▁▂▂▂▂▂▂▂▁▂▂▂▂

[up/down: Move | 's': Scale | 'q': Quit]  scale: all  * = stale (5s)                              [9/17]

Base automatically changed from alan/ctop-select to main September 17, 2026 17:44
The DELTA column says how much work an upstairs has done since the
last update, which does not distinguish one that has been busy for a
 minute from one that just woke up.  Keep the last hundred deltas per
 session and graph them in whatever width the columns leave over.

Every row is scaled against the largest sample on screen rather than
its own range, so the rows can be compared with each other.  The cost
is that a quiet session next to a busy one reads as flat, which is the
honest answer to "is this one doing anything".

The axis counts samples, not time: a session that stops reporting adds
nothing, so its sparkline keeps its shape rather than growing a gap.
This is something to address in a future PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants