Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(console): remove histogram minimum count (#424)
The sparklines histogram used to visualize poll times and scheduled times renders a legend for both axes. On the horizontal axis, it displays the durations for the minimum and maximum buckets. On the vertical axis, it displays the bucket count minimum and maximums. Unfortunately, the minimum values for each axis are places together, which can be confusing: ```text ╭Poll Times Histogram─────────────────────────────────╮ │46█ │ │ █ │ │ █ │ │ █ │ │ █ ▂ │ │ █▁█▇▃▁▁ ▁ ▁▁ ▁ │ │ 031.23µs 7.11ms│ ╰─────────────────────────────────────────────────────╯ ^|----| │ ╰─ This is the minimum bucket duration value ╰── This is the minimum count ``` This can be confusing because it looks like there is an erroneous leading zero on the minimum bucket duration. If the minimum value is not zero, then the vertical axis minimum is updated, but the bottom of the sparkline still represents zero. This sitaution is unlikely, I had to add a fixed value to the bucket counts to generate the histogram below. ```text ╭Poll Times Histogram─────────────────────────────────╮ │32██ │ │ ██▇ ▁ ▁ ▁ ▁ ▁ │ │ ███▇▆▆▆█▇▆▇▆▆▆▆▆▆▆▇▆▆▆▆█▆▇▆█▆▇█▆█▇▇▇▆▇▇▆▇▆▆▇▆▆▆▆▆▇ │ │ ██████████████████████████████████████████████████ │ │ ██████████████████████████████████████████████████ │ │ ██████████████████████████████████████████████████ │ │2033.79µs 536.58µs │ ╰─────────────────────────────────────────────────────╯ ^^|----| │ ╰─ This is the minimum bucket duration value ╰── This is the minimum count ``` This is probably misleading. This change removes the minimum label on the vertical axis entirely. This removes the confusion around the "erroneous" leading zero and since the bottom of the graph is always zero anyway, it should be clear to users without having to add the label. The resulting histogram looks like: ```text ╭Poll Times Histogram─────────────────────────────────╮ │27 █▄ │ │ ██ │ │ ██ │ │ ██ │ │ ██▂ │ │ ▃███▃▁ ▁ ▁▃ ▃▃▃▁▃▅▁▃ ▃▃▃▃▃▁▁▁ ▁ ▁ ▁│ │ 28.93µs 811.01µs │ ╰─────────────────────────────────────────────────────╯ ```
- Loading branch information