diff options
author | Signed-off-by: Chuck Lever <chuck.lever@oracle.com> | 2014-11-04 14:02:05 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2014-11-04 14:04:08 -0500 |
commit | 8f2e933aec15d06b0f1d95ea08c72e4d497f8dbf (patch) | |
tree | 60c862b5197e7e586deb7626301a977672ff83a8 | |
parent | a34ded08b39cc29652030a3f0a16c13ea977d9cb (diff) | |
download | nfs-utils-8f2e933aec15d06b0f1d95ea08c72e4d497f8dbf.tar.gz nfs-utils-8f2e933aec15d06b0f1d95ea08c72e4d497f8dbf.tar.xz nfs-utils-8f2e933aec15d06b0f1d95ea08c72e4d497f8dbf.zip |
mountstats: Don't display retrans stats unless there are re-xmit
Clean up display of RPC statistics by omitting retransmit statistics
when there have been no retransmissions.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r-- | tools/mountstats/mountstats.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/mountstats/mountstats.py b/tools/mountstats/mountstats.py index 1fb3e2f..9a6ec43 100644 --- a/tools/mountstats/mountstats.py +++ b/tools/mountstats/mountstats.py @@ -272,8 +272,11 @@ class DeviceData: print('%s:' % op) print('\t%d ops (%d%%)' % \ (count, ((count * 100) / sends)), end=' ') - print('\t%d retrans (%d%%)' % (retrans, ((retrans * 100) / count)), end=' ') - print('\t%d major timeouts' % stats[2]) + if retrans != 0: + print('\t%d retrans (%d%%)' % (retrans, ((retrans * 100) / count)), end=' ') + print('\t%d major timeouts' % stats[2]) + else: + print('') print('\tavg bytes sent per op: %d\tavg bytes received per op: %d' % \ (stats[3] / count, stats[4] / count)) print('\tbacklog wait: %f' % (float(stats[5]) / count), end=' ') |