From: Steve Dickson <SteveD@redhat.com>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 1/2] nfs-iostat: Fix columnarization of RPC statistics
Date: Wed, 30 Apr 2014 12:30:50 -0400 [thread overview]
Message-ID: <5361253A.4010708@RedHat.com> (raw)
In-Reply-To: <20140425165211.30699.73059.stgit@manet.1015granger.net>
On 04/25/2014 12:52 PM, Chuck Lever wrote:
> Note: format() is new with Python 2.6
>
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Committed...
steved.
> ---
>
> tools/nfs-iostat/nfs-iostat.py | 31 +++++++++++++++++++------------
> 1 files changed, 19 insertions(+), 12 deletions(-)
>
> diff --git a/tools/nfs-iostat/nfs-iostat.py b/tools/nfs-iostat/nfs-iostat.py
> index 341cdbf..6831c12 100644
> --- a/tools/nfs-iostat/nfs-iostat.py
> +++ b/tools/nfs-iostat/nfs-iostat.py
> @@ -353,15 +353,21 @@ class DeviceData:
> exe_per_op = 0.0
>
> op += ':'
> - print('%s' % op.lower().ljust(15), end='')
> - print(' ops/s\t\t kB/s\t\t kB/op\t\tretrans\t\tavg RTT (ms)\tavg exe (ms)')
> -
> - print('\t\t%7.3f' % (ops / sample_time), end='')
> - print('\t%7.3f' % (kilobytes / sample_time), end='')
> - print('\t%7.3f' % kb_per_op, end='')
> - print(' %7d (%3.1f%%)' % (retrans, retrans_percent), end='')
> - print('\t%7.3f' % rtt_per_op, end='')
> - print('\t%7.3f' % exe_per_op)
> + print(format(op.lower(), '<16s'), end='')
> + print(format('ops/s', '>8s'), end='')
> + print(format('kB/s', '>16s'), end='')
> + print(format('kB/op', '>16s'), end='')
> + print(format('retrans', '>16s'), end='')
> + print(format('avg RTT (ms)', '>16s'), end='')
> + print(format('avg exe (ms)', '>16s'))
> +
> + print(format((ops / sample_time), '>24.3f'), end='')
> + print(format((kilobytes / sample_time), '>16.3f'), end='')
> + print(format(kb_per_op, '>16.3f'), end='')
> + retransmits = '{0:>10.0f} ({1:>3.1f}%)'.format(retrans, retrans_percent).strip()
> + print(format(retransmits, '>16'), end='')
> + print(format(rtt_per_op, '>16.3f'), end='')
> + print(format(exe_per_op, '>16.3f'))
>
> def ops(self, sample_time):
> sends = float(self.__rpc_data['rpcsends'])
> @@ -391,9 +397,10 @@ class DeviceData:
> (self.__nfs_data['export'], self.__nfs_data['mountpoint']))
> print()
>
> - print(' op/s\t\trpc bklog')
> - print('%7.2f' % (sends / sample_time), end='')
> - print('\t%7.2f' % backlog)
> + print(format('ops/s', '>16') + format('rpc bklog', '>16'))
> + print(format((sends / sample_time), '>16.3f'), end='')
> + print(format(backlog, '>16.3f'))
> + print()
>
> if which == 0:
> self.__print_rpc_op_stats('READ', sample_time)
>
prev parent reply other threads:[~2014-04-30 16:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-25 16:52 [PATCH 1/2] nfs-iostat: Fix columnarization of RPC statistics Chuck Lever
2014-04-25 16:52 ` [PATCH 2/2] nfs-iostat: Fix attribute cache statistics Chuck Lever
2014-04-30 16:31 ` Steve Dickson
2014-04-30 16:30 ` Steve Dickson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5361253A.4010708@RedHat.com \
--to=steved@redhat.com \
--cc=chuck.lever@oracle.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.