lqtop: make more room for large rtts

IPv6 is a max of 40 characters, so I cut the allowed space to 42.
That gave room to have multi-second long observable RTTs in the
RTT segment.

Compile tested only. A slightly better approach might be to
display time in ns/us/ms/s.
This commit is contained in:
Dave Taht
2023-02-02 20:40:45 +00:00
parent 48b75a9b10
commit f636cd9ff0

View File

@@ -128,7 +128,7 @@ fn draw_top_pane<'a>(
scale_packets(stats.packets_per_second.1)
)),
Cell::from(format!(
"{:>7} ms",
"{:>10} ms",
format!("{:.2}", stats.median_tcp_rtt)
)),
Cell::from(format!("{:>7}", stats.tc_handle.to_string())),
@@ -154,12 +154,12 @@ fn draw_top_pane<'a>(
Block::default().title(draw_pps(packets_per_second, bits_per_second)),
)
.widths(&[
Constraint::Min(40),
Constraint::Min(42),
Constraint::Length(15),
Constraint::Length(15),
Constraint::Length(15),
Constraint::Length(15),
Constraint::Length(15),
Constraint::Length(11),
Constraint::Length(7),
])
}