From owner-freebsd-bugs@FreeBSD.ORG Tue Jan 3 21:50:10 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C3EC216A41F for ; Tue, 3 Jan 2006 21:50:10 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 56BAC43D60 for ; Tue, 3 Jan 2006 21:50:10 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k03Lo9jX062561 for ; Tue, 3 Jan 2006 21:50:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k03Lo9ke062560; Tue, 3 Jan 2006 21:50:09 GMT (envelope-from gnats) Date: Tue, 3 Jan 2006 21:50:09 GMT Message-Id: <200601032150.k03Lo9ke062560@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Giorgos Keramidas Cc: Subject: Re: bin/91034: minor fix to iostat so that columns line up with 128KB xfers X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Giorgos Keramidas List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2006 21:50:10 -0000 The following reply was made to PR bin/91034; it has been noted by GNATS. From: Giorgos Keramidas To: Bruce Evans Cc: bug-followup@FreeBSD.org Subject: Re: bin/91034: minor fix to iostat so that columns line up with 128KB xfers Date: Tue, 3 Jan 2006 23:46:52 +0200 On 2006-01-03 22:40, Bruce Evans wrote: >On Tue, 3 Jan 2006, Giorgos Keramidas wrote: >>On 2005-12-28 21:16, Robert Cousins wrote: >>> Iostat's output can be kind of ugly under USF2 with 128KB >>> transfers. Here is an example: >>> ... >>> The patch I'm submitting notices when this value is >= 100 and >>> drops from 2 decimals to 1 in this case. The result is an output >>> like this: >>> >>> tty ad0 ad1 cpu >>> tin tout KB/t tps MB/s KB/t tps MB/s us ni sy in id >>> 0 60 0.00 0 0.00 0.00 0 0.00 50 0 0 0 50 >>> 0 180 0.00 0 0.00 128.0 8 1.00 48 0 0 0 51 >>> 0 61 0.00 0 0.00 0.00 0 0.00 50 0 0 0 50 >>> 0 60 0.00 0 0.00 0.00 0 0.00 49 0 0 0 51 >> >> The misaligned dots seem a bit ugly. > > Indeed. They are like the -h (hideous or human-unreadable) output > in many utilities. Exponential notation and columns that aren't > lined up are hard for humans to read. > > >Is it ok to use %6.2Lf as > >the format specifier, widening the KB columns a bit to fit the > >new length of the text? > > No. There is space in the above, but most systems have more than 2 drives > (most of mine have 6, with 4 physical drives and extras from atapicam > duplicating acd0 and cam giving a virtual drive pass0). Info about 3 > drives just fits in 80 columns with %5.2Lf format. It results in 77 > coumns being used. %6.2Lf format would result in 80 columns being used > and thus ugly line wrap on some terminals (or the number of drives being > limited to 2). So, there's no way to keep the pretty format of current iostat output *and* account for larger transfer speeds? :-( Looking at an awk-formatted version of the iostat output it seems that even with 3 disks we *do* hae 3 columns to spare until 79 columns are reached: $ iostat ad0 da0 pass0 | awk '{printf "%-78s|\n",$0}' tty ad0 da0 pass0 cpu | tin tout KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s us ni sy in id | 63 514 7.10 13 0.09 0.01 0 0.00 0.00 0 0.00 1 0 2 0 96 | $ Is this enough for adding an extra column to every KB/t column and still keeping everything under 80 columns?