converge: the Device column is fixed at 23 characters, and the default name of 1475 catalogue devices is longer #1732

Closed
opened 2026-11-16 21:17:04 +00:00 by jaylouisw · 0 comments
Owner

The measurement

_converge() prints its table from three fixed widths:

out.push('Process   Device                 Ready   Basis');
... pad(e.process, 10) + pad(e.device.name || e.deviceId, 23) + pad(e.readyAtMs + ' ms', 10) + basis

pad() right-pads and never truncates, so a name of 24 characters or more does not widen its column - it runs straight into the instant beside it. A lab of two ISR 4331s, nothing renamed:

r1#converge 1000
Process   Device                 Ready   Basis
ospf      ISR 4331 branch router-r116000 ms  hello 10 s + exchange, then SPF hold  (pending)

router-r1 followed immediately by 16000 ms reads as the instant r116000 ms on a device called router-r1; the Ready column cannot be found by eye and the row cannot be read field by field.

Why this is the default case, not the long-name case

A device with no explicit name gets label + '-' + last four characters of the id (engine/device.js:168). Counting that suffix, 1475 of the 2329 specs in devices/ have a default name longer than 22 characters, and 79 more land exactly on 23. So this is what the console prints for an untouched lab on the majority of the catalogue, not only for someone who renamed a box to something long.

The heading was wrong too

The header text was typed by hand rather than built from the row widths, and it said Ready Basis - three spaces - while the rows put their basis text ten characters after the instant. In the sample in docs/CONVERGENCE.md the heading's Basis sat at column 41 and the data at column 43. A heading is a row like any other.

Proposed

Same rule show lldp neighbors already follows (#1265): take the widths from the data, keep the existing minimums so a short-named lab prints exactly what it printed before, and build header and rows from those one widths. Widening docs/CONVERGENCE.md and docs/LINK-STATE.md samples accordingly.

## The measurement `_converge()` prints its table from three fixed widths: ```js out.push('Process Device Ready Basis'); ... pad(e.process, 10) + pad(e.device.name || e.deviceId, 23) + pad(e.readyAtMs + ' ms', 10) + basis ``` `pad()` right-pads and never truncates, so a name of 24 characters or more does not widen its column - it runs straight into the instant beside it. A lab of two ISR 4331s, nothing renamed: ``` r1#converge 1000 Process Device Ready Basis ospf ISR 4331 branch router-r116000 ms hello 10 s + exchange, then SPF hold (pending) ``` `router-r1` followed immediately by `16000 ms` reads as the instant `r116000 ms` on a device called `router-r1`; the Ready column cannot be found by eye and the row cannot be read field by field. ## Why this is the default case, not the long-name case A device with no explicit name gets `label + '-' + last four characters of the id` (`engine/device.js:168`). Counting that suffix, **1475 of the 2329 specs in `devices/` have a default name longer than 22 characters**, and 79 more land exactly on 23. So this is what the console prints for an untouched lab on the majority of the catalogue, not only for someone who renamed a box to something long. ## The heading was wrong too The header text was typed by hand rather than built from the row widths, and it said `Ready Basis` - three spaces - while the rows put their basis text ten characters after the instant. In the sample in `docs/CONVERGENCE.md` the heading's `Basis` sat at column 41 and the data at column 43. A heading is a row like any other. ## Proposed Same rule `show lldp neighbors` already follows (#1265): take the widths from the data, keep the existing minimums so a short-named lab prints exactly what it printed before, and build header and rows from those one widths. Widening `docs/CONVERGENCE.md` and `docs/LINK-STATE.md` samples accordingly.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge#1732
No description provided.