[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210503075739.46654252@hermes.local>
Date: Mon, 3 May 2021 07:57:39 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: Jakub Kicinski <kuba@...nel.org>
Cc: dsahern@...il.com, netdev@...r.kernel.org
Subject: Re: [PACTH iproute2-next] ip: dynamically size columns when
printing stats
On Fri, 30 Apr 2021 20:10:59 -0700
Jakub Kicinski <kuba@...nel.org> wrote:
> This change makes ip -s -s output size the columns
> automatically. I often find myself using json
> output because the normal output is unreadable.
> Even on a laptop after 2 days of uptime byte
> and packet counters almost overflow their columns,
> let alone a busy server.
>
> For max readability switch to right align.
>
> Before:
>
> RX: bytes packets errors dropped missed mcast
> 8227918473 8617683 0 0 0 0
> RX errors: length crc frame fifo overrun
> 0 0 0 0 0
> TX: bytes packets errors dropped carrier collsns
> 691937917 4727223 0 0 0 0
> TX errors: aborted fifo window heartbeat transns
> 0 0 0 0 10
>
> After:
>
> RX: bytes packets errors dropped missed mcast
> 8228633710 8618408 0 0 0 0
> RX errors: length crc frame fifo overrun
> 0 0 0 0 0
> TX: bytes packets errors dropped carrier collsns
> 692006303 4727740 0 0 0 0
> TX errors: aborted fifo window heartbt transns
> 0 0 0 0 10
>
> More importantly, with large values before:
>
> RX: bytes packets errors dropped overrun mcast
> 126570234447969 15016149200 0 0 0 0
> RX errors: length crc frame fifo missed
> 0 0 0 0 0
> TX: bytes packets errors dropped carrier collsns
> 126570234447969 15016149200 0 0 0 0
> TX errors: aborted fifo window heartbeat transns
> 0 0 0 0 10
>
> Note that in this case we have full shift by a column,
> e.g. the value under "dropped" is actually for "errors" etc.
>
> After:
>
> RX: bytes packets errors dropped missed mcast
> 126570234447969 15016149200 0 0 0 0
> RX errors: length crc frame fifo overrun
> 0 0 0 0 0
> TX: bytes packets errors dropped carrier collsns
> 126570234447969 15016149200 0 0 0 0
> TX errors: aborted fifo window heartbt transns
> 0 0 0 0 10
>
> Signed-off-by: Jakub Kicinski <kuba@...nel.org>
Looks good to me.
Maybe good time to refactor the code to make it table driven rather
than individual statistic items.
Powered by blists - more mailing lists