Skip to contentSkip to conversation

mountstats: Don't display retrans stats unless there are re-xmits

PATCH In review Chuck Lever 2 participants 2 messages Oct 31, 2014 – Nov 4, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mountstats: Don't display retrans stats unless there are re-xmits

Clean up display of RPC statistics by omitting retransmit statistics when there have been no retransmissions.

---
 tools/mountstats/mountstats.py |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
tools/mountstats/mountstats.py +5 -2
index 1fb3e2f..9a6ec43 100644
@@ -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=' ')
#1 lore raw
Quoted 4 lines · Chuck Lever

Clean up display of RPC statistics by omitting retransmit statistics when there have been no retransmissions.

Committed...

steved.

Quoted 23 lines
---
 tools/mountstats/mountstats.py |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
tools/mountstats/mountstats.py +5 -2
index 1fb3e2f..9a6ec43 100644
@@ -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=' ')