|
|
bc9fd4 |
diff --git a/tools/mountstats/mountstats.py b/tools/mountstats/mountstats.py
|
|
|
bc9fd4 |
index 48ef0964..bda9af67 100755
|
|
|
bc9fd4 |
--- a/tools/mountstats/mountstats.py
|
|
|
bc9fd4 |
+++ b/tools/mountstats/mountstats.py
|
|
|
bc9fd4 |
@@ -308,6 +308,8 @@ class DeviceData:
|
|
|
bc9fd4 |
op = words[0][:-1]
|
|
|
bc9fd4 |
self.__rpc_data['ops'] += [op]
|
|
|
bc9fd4 |
self.__rpc_data[op] = [int(word) for word in words[1:]]
|
|
|
bc9fd4 |
+ if len(self.__rpc_data[op]) < 9:
|
|
|
bc9fd4 |
+ self.__rpc_data[op] += [0]
|
|
|
bc9fd4 |
|
|
|
bc9fd4 |
def parse_stats(self, lines):
|
|
|
bc9fd4 |
"""Turn a list of lines from a mount stat file into a
|
|
|
bc9fd4 |
@@ -475,7 +477,9 @@ class DeviceData:
|
|
|
bc9fd4 |
retrans = stats[2] - count
|
|
|
bc9fd4 |
if retrans != 0:
|
|
|
bc9fd4 |
print('\t%d retrans (%d%%)' % (retrans, ((retrans * 100) / count)), end=' ')
|
|
|
bc9fd4 |
- print('\t%d major timeouts' % stats[3])
|
|
|
bc9fd4 |
+ print('\t%d major timeouts' % stats[3], end='')
|
|
|
bc9fd4 |
+ if len(stats) >= 10 and stats[9] != 0:
|
|
|
bc9fd4 |
+ print('\t%d errors (%d%%)' % (stats[9], ((stats[9] * 100) / count)))
|
|
|
bc9fd4 |
else:
|
|
|
bc9fd4 |
print('')
|
|
|
bc9fd4 |
print('\tavg bytes sent per op: %d\tavg bytes received per op: %d' % \
|
|
|
bc9fd4 |
@@ -580,7 +584,7 @@ class DeviceData:
|
|
|
bc9fd4 |
self.__nfs_data['fstype'] = 'nfs4'
|
|
|
bc9fd4 |
self.__rpc_data['ops'] = ops
|
|
|
bc9fd4 |
for op in ops:
|
|
|
bc9fd4 |
- self.__rpc_data[op] = [0 for i in range(8)]
|
|
|
bc9fd4 |
+ self.__rpc_data[op] = [0 for i in range(9)]
|
|
|
bc9fd4 |
|
|
|
bc9fd4 |
def accumulate_iostats(self, new_stats):
|
|
|
bc9fd4 |
"""Accumulate counters from all RPC op buckets in new_stats. This is
|
|
|
bc9fd4 |
@@ -605,6 +609,8 @@ class DeviceData:
|
|
|
bc9fd4 |
queued_for = float(rpc_stats[5])
|
|
|
bc9fd4 |
rtt = float(rpc_stats[6])
|
|
|
bc9fd4 |
exe = float(rpc_stats[7])
|
|
|
bc9fd4 |
+ if len(rpc_stats) >= 9:
|
|
|
bc9fd4 |
+ errs = int(rpc_stats[8])
|
|
|
bc9fd4 |
|
|
|
bc9fd4 |
# prevent floating point exceptions
|
|
|
bc9fd4 |
if ops != 0:
|
|
|
bc9fd4 |
@@ -613,12 +619,15 @@ class DeviceData:
|
|
|
bc9fd4 |
rtt_per_op = rtt / ops
|
|
|
bc9fd4 |
exe_per_op = exe / ops
|
|
|
bc9fd4 |
queued_for_per_op = queued_for / ops
|
|
|
bc9fd4 |
+ if len(rpc_stats) >= 9:
|
|
|
bc9fd4 |
+ errs_percent = (errs * 100) / ops
|
|
|
bc9fd4 |
else:
|
|
|
bc9fd4 |
kb_per_op = 0.0
|
|
|
bc9fd4 |
retrans_percent = 0.0
|
|
|
bc9fd4 |
rtt_per_op = 0.0
|
|
|
bc9fd4 |
exe_per_op = 0.0
|
|
|
bc9fd4 |
queued_for_per_op = 0.0
|
|
|
bc9fd4 |
+ errs_percent = 0.0
|
|
|
bc9fd4 |
|
|
|
bc9fd4 |
op += ':'
|
|
|
bc9fd4 |
print(format(op.lower(), '<16s'), end='')
|
|
|
bc9fd4 |
@@ -628,7 +637,10 @@ class DeviceData:
|
|
|
bc9fd4 |
print(format('retrans', '>16s'), end='')
|
|
|
bc9fd4 |
print(format('avg RTT (ms)', '>16s'), end='')
|
|
|
bc9fd4 |
print(format('avg exe (ms)', '>16s'), end='')
|
|
|
bc9fd4 |
- print(format('avg queue (ms)', '>16s'))
|
|
|
bc9fd4 |
+ print(format('avg queue (ms)', '>16s'), end='')
|
|
|
bc9fd4 |
+ if len(rpc_stats) >= 9:
|
|
|
bc9fd4 |
+ print(format('errors', '>16s'), end='')
|
|
|
bc9fd4 |
+ print()
|
|
|
bc9fd4 |
|
|
|
bc9fd4 |
print(format((ops / sample_time), '>24.3f'), end='')
|
|
|
bc9fd4 |
print(format((kilobytes / sample_time), '>16.3f'), end='')
|
|
|
bc9fd4 |
@@ -637,7 +649,11 @@ class DeviceData:
|
|
|
bc9fd4 |
print(format(retransmits, '>16'), end='')
|
|
|
bc9fd4 |
print(format(rtt_per_op, '>16.3f'), end='')
|
|
|
bc9fd4 |
print(format(exe_per_op, '>16.3f'), end='')
|
|
|
bc9fd4 |
- print(format(queued_for_per_op, '>16.3f'))
|
|
|
bc9fd4 |
+ print(format(queued_for_per_op, '>16.3f'), end='')
|
|
|
bc9fd4 |
+ if len(rpc_stats) >= 9:
|
|
|
bc9fd4 |
+ errors = '{0:>10.0f} ({1:>3.1f}%)'.format(errs, errs_percent).strip()
|
|
|
bc9fd4 |
+ print(format(errors, '>16'), end='')
|
|
|
bc9fd4 |
+ print()
|
|
|
bc9fd4 |
|
|
|
bc9fd4 |
def display_iostats(self, sample_time):
|
|
|
bc9fd4 |
"""Display NFS and RPC stats in an iostat-like way
|
|
|
bc9fd4 |
diff --git a/tools/nfs-iostat/nfs-iostat.py b/tools/nfs-iostat/nfs-iostat.py
|
|
|
bc9fd4 |
old mode 100644
|
|
|
bc9fd4 |
new mode 100755
|
|
|
bc9fd4 |
index f1556fb7..5b2260ad
|
|
|
bc9fd4 |
--- a/tools/nfs-iostat/nfs-iostat.py
|
|
|
bc9fd4 |
+++ b/tools/nfs-iostat/nfs-iostat.py
|
|
|
bc9fd4 |
@@ -329,6 +329,8 @@ class DeviceData:
|
|
|
bc9fd4 |
queued_for = float(rpc_stats[5])
|
|
|
bc9fd4 |
rtt = float(rpc_stats[6])
|
|
|
bc9fd4 |
exe = float(rpc_stats[7])
|
|
|
bc9fd4 |
+ if len(rpc_stats) >= 9:
|
|
|
bc9fd4 |
+ errs = float(rpc_stats[8])
|
|
|
bc9fd4 |
|
|
|
bc9fd4 |
# prevent floating point exceptions
|
|
|
bc9fd4 |
if ops != 0:
|
|
|
bc9fd4 |
@@ -337,12 +339,16 @@ class DeviceData:
|
|
|
bc9fd4 |
rtt_per_op = rtt / ops
|
|
|
bc9fd4 |
exe_per_op = exe / ops
|
|
|
bc9fd4 |
queued_for_per_op = queued_for / ops
|
|
|
bc9fd4 |
+ if len(rpc_stats) >= 9:
|
|
|
bc9fd4 |
+ errs_percent = (errs * 100) / ops
|
|
|
bc9fd4 |
else:
|
|
|
bc9fd4 |
kb_per_op = 0.0
|
|
|
bc9fd4 |
retrans_percent = 0.0
|
|
|
bc9fd4 |
rtt_per_op = 0.0
|
|
|
bc9fd4 |
exe_per_op = 0.0
|
|
|
bc9fd4 |
queued_for_per_op = 0.0
|
|
|
bc9fd4 |
+ if len(rpc_stats) >= 9:
|
|
|
bc9fd4 |
+ errs_percent = 0.0
|
|
|
bc9fd4 |
|
|
|
bc9fd4 |
op += ':'
|
|
|
bc9fd4 |
print(format(op.lower(), '<16s'), end='')
|
|
|
bc9fd4 |
@@ -352,7 +358,10 @@ class DeviceData:
|
|
|
bc9fd4 |
print(format('retrans', '>16s'), end='')
|
|
|
bc9fd4 |
print(format('avg RTT (ms)', '>16s'), end='')
|
|
|
bc9fd4 |
print(format('avg exe (ms)', '>16s'), end='')
|
|
|
bc9fd4 |
- print(format('avg queue (ms)', '>16s'))
|
|
|
bc9fd4 |
+ print(format('avg queue (ms)', '>16s'), end='')
|
|
|
bc9fd4 |
+ if len(rpc_stats) >= 9:
|
|
|
bc9fd4 |
+ print(format('errors', '>16s'), end='')
|
|
|
bc9fd4 |
+ print()
|
|
|
bc9fd4 |
|
|
|
bc9fd4 |
print(format((ops / sample_time), '>24.3f'), end='')
|
|
|
bc9fd4 |
print(format((kilobytes / sample_time), '>16.3f'), end='')
|
|
|
bc9fd4 |
@@ -361,7 +370,11 @@ class DeviceData:
|
|
|
bc9fd4 |
print(format(retransmits, '>16'), end='')
|
|
|
bc9fd4 |
print(format(rtt_per_op, '>16.3f'), end='')
|
|
|
bc9fd4 |
print(format(exe_per_op, '>16.3f'), end='')
|
|
|
bc9fd4 |
- print(format(queued_for_per_op, '>16.3f'))
|
|
|
bc9fd4 |
+ print(format(queued_for_per_op, '>16.3f'), end='')
|
|
|
bc9fd4 |
+ if len(rpc_stats) >= 9:
|
|
|
bc9fd4 |
+ errors = '{0:>10.0f} ({1:>3.1f}%)'.format(errs, errs_percent).strip()
|
|
|
bc9fd4 |
+ print(format(errors, '>16'), end='')
|
|
|
bc9fd4 |
+ print()
|
|
|
bc9fd4 |
|
|
|
bc9fd4 |
def ops(self, sample_time):
|
|
|
bc9fd4 |
sends = float(self.__rpc_data['rpcsends'])
|
|
|
bc9fd4 |
diff --git a/tools/nfs-iostat/nfsiostat.man b/tools/nfs-iostat/nfsiostat.man
|
|
|
bc9fd4 |
index 9ae94c5f..940c0431 100644
|
|
|
bc9fd4 |
--- a/tools/nfs-iostat/nfsiostat.man
|
|
|
bc9fd4 |
+++ b/tools/nfs-iostat/nfsiostat.man
|
|
|
bc9fd4 |
@@ -97,6 +97,14 @@ This is the duration from the time the NFS client created the RPC request task t
|
|
|
bc9fd4 |
.RE
|
|
|
bc9fd4 |
.RE
|
|
|
bc9fd4 |
.RE
|
|
|
bc9fd4 |
+.RS 8
|
|
|
bc9fd4 |
+- \fBerrors\fR
|
|
|
bc9fd4 |
+.RS
|
|
|
bc9fd4 |
+This is the number of operations that completed with an error status (status < 0). This count is only available on kernels with RPC iostats version 1.1 or above.
|
|
|
bc9fd4 |
+.RS
|
|
|
bc9fd4 |
+.RE
|
|
|
bc9fd4 |
+.RE
|
|
|
bc9fd4 |
+.RE
|
|
|
bc9fd4 |
.TP
|
|
|
bc9fd4 |
Note that if an interval is used as argument to \fBnfsiostat\fR, then the diffrence from previous interval will be displayed, otherwise the results will be from the time that the share was mounted.
|
|
|
bc9fd4 |
|