All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] nfsiostat: Add error counts to output when RPC iostats version >= 1.1
@ 2019-06-24 21:16 Dave Wysochanski
  2019-06-24 21:16 ` [PATCH 2/2] mountstats: Add per-op error counts to iostat command " Dave Wysochanski
  2019-08-01 16:13 ` [PATCH 1/2] nfsiostat: Add error counts to output " Steve Dickson
  0 siblings, 2 replies; 4+ messages in thread
From: Dave Wysochanski @ 2019-06-24 21:16 UTC (permalink / raw)
  To: chuck.lever, SteveD; +Cc: linux-nfs

With RPC iostats 1.1 there is a new metric which counts the RPCs
completing with errors (tk_status < 0).  Add these to the output at
the end of the line.  This increases the length of an output line
to 136 columns from 120, but keeps consistent format and spacing:

read:              ops/s            kB/s           kB/op         retrans    avg RTT (ms)    avg exe (ms)  avg queue (ms)          errors
                   0.000           0.106         512.316        0 (0.0%)          17.500          17.500           0.000        0 (0.0%)
write:             ops/s            kB/s           kB/op         retrans    avg RTT (ms)    avg exe (ms)  avg queue (ms)          errors
                   0.001           0.476         512.398        0 (0.0%)           1.667           5.778           3.889       1 (11.1%)

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
---
 tools/nfs-iostat/nfs-iostat.py | 17 +++++++++++++++--
 tools/nfs-iostat/nfsiostat.man |  8 ++++++++
 2 files changed, 23 insertions(+), 2 deletions(-)
 mode change 100644 => 100755 tools/nfs-iostat/nfs-iostat.py

diff --git a/tools/nfs-iostat/nfs-iostat.py b/tools/nfs-iostat/nfs-iostat.py
old mode 100644
new mode 100755
index dec0e861..b7e98a2a
--- a/tools/nfs-iostat/nfs-iostat.py
+++ b/tools/nfs-iostat/nfs-iostat.py
@@ -329,6 +329,8 @@ class DeviceData:
         queued_for = float(rpc_stats[5])
         rtt = float(rpc_stats[6])
         exe = float(rpc_stats[7])
+        if len(rpc_stats) >= 9:
+            errs = float(rpc_stats[8])
 
         # prevent floating point exceptions
         if ops != 0:
@@ -337,12 +339,16 @@ class DeviceData:
             rtt_per_op = rtt / ops
             exe_per_op = exe / ops
             queued_for_per_op = queued_for / ops
+            if len(rpc_stats) >= 9:
+                errs_percent = (errs * 100) / ops
         else:
             kb_per_op = 0.0
             retrans_percent = 0.0
             rtt_per_op = 0.0
             exe_per_op = 0.0
             queued_for_per_op = 0.0
+            if len(rpc_stats) >= 9:
+                errs_percent = 0.0
 
         op += ':'
         print(format(op.lower(), '<16s'), end='')
@@ -352,7 +358,10 @@ class DeviceData:
         print(format('retrans', '>16s'), end='')
         print(format('avg RTT (ms)', '>16s'), end='')
         print(format('avg exe (ms)', '>16s'), end='')
-        print(format('avg queue (ms)', '>16s'))
+        print(format('avg queue (ms)', '>16s'), end='')
+        if len(rpc_stats) >= 9:
+            print(format('errors', '>16s'), end='')
+        print()
 
         print(format((ops / sample_time), '>24.3f'), end='')
         print(format((kilobytes / sample_time), '>16.3f'), end='')
@@ -361,7 +370,11 @@ class DeviceData:
         print(format(retransmits, '>16'), end='')
         print(format(rtt_per_op, '>16.3f'), end='')
         print(format(exe_per_op, '>16.3f'), end='')
-        print(format(queued_for_per_op, '>16.3f'))
+        print(format(queued_for_per_op, '>16.3f'), end='')
+        if len(rpc_stats) >= 9:
+            errors = '{0:>10.0f} ({1:>3.1f}%)'.format(errs, errs_percent).strip()
+            print(format(errors, '>16'), end='')
+        print()
 
     def ops(self, sample_time):
         sends = float(self.__rpc_data['rpcsends'])
diff --git a/tools/nfs-iostat/nfsiostat.man b/tools/nfs-iostat/nfsiostat.man
index 9ae94c5f..940c0431 100644
--- a/tools/nfs-iostat/nfsiostat.man
+++ b/tools/nfs-iostat/nfsiostat.man
@@ -97,6 +97,14 @@ This is the duration from the time the NFS client created the RPC request task t
 .RE
 .RE
 .RE
+.RS 8
+- \fBerrors\fR
+.RS
+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.
+.RS
+.RE
+.RE
+.RE
 .TP
 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.
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] mountstats: Add per-op error counts to iostat command when RPC iostats version >= 1.1
  2019-06-24 21:16 [PATCH 1/2] nfsiostat: Add error counts to output when RPC iostats version >= 1.1 Dave Wysochanski
@ 2019-06-24 21:16 ` Dave Wysochanski
  2019-08-01 16:13   ` Steve Dickson
  2019-08-01 16:13 ` [PATCH 1/2] nfsiostat: Add error counts to output " Steve Dickson
  1 sibling, 1 reply; 4+ messages in thread
From: Dave Wysochanski @ 2019-06-24 21:16 UTC (permalink / raw)
  To: chuck.lever, SteveD; +Cc: linux-nfs

With RPC iostats 1.1 there is a new metric which counts the RPCs
completing with errors (tk_status < 0).  Add these to the output at
the end of the line.  This increases the length of an output line
to 136 columns from 120, but keeps consistent format and spacing:

read:              ops/s            kB/s           kB/op         retrans    avg RTT (ms)    avg exe (ms)  avg queue (ms)          errors
                   0.000           0.106         512.316        0 (0.0%)          17.500          17.500           0.000        0 (0.0%)
write:             ops/s            kB/s           kB/op         retrans    avg RTT (ms)    avg exe (ms)  avg queue (ms)          errors
                   0.001           0.476         512.398        0 (0.0%)           1.667           5.778           3.889       1 (11.1%)

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
---
 tools/mountstats/mountstats.py | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/tools/mountstats/mountstats.py b/tools/mountstats/mountstats.py
index 2f525f4b..c5e8f506 100755
--- a/tools/mountstats/mountstats.py
+++ b/tools/mountstats/mountstats.py
@@ -607,6 +607,8 @@ class DeviceData:
         queued_for = float(rpc_stats[5])
         rtt = float(rpc_stats[6])
         exe = float(rpc_stats[7])
+        if len(rpc_stats) >= 9:
+            errs = int(rpc_stats[8])
 
         # prevent floating point exceptions
         if ops != 0:
@@ -615,12 +617,15 @@ class DeviceData:
             rtt_per_op = rtt / ops
             exe_per_op = exe / ops
             queued_for_per_op = queued_for / ops
+            if len(rpc_stats) >= 9:
+                errs_percent = (errs * 100) / ops
         else:
             kb_per_op = 0.0
             retrans_percent = 0.0
             rtt_per_op = 0.0
             exe_per_op = 0.0
             queued_for_per_op = 0.0
+            errs_percent = 0.0
 
         op += ':'
         print(format(op.lower(), '<16s'), end='')
@@ -630,7 +635,10 @@ class DeviceData:
         print(format('retrans', '>16s'), end='')
         print(format('avg RTT (ms)', '>16s'), end='')
         print(format('avg exe (ms)', '>16s'), end='')
-        print(format('avg queue (ms)', '>16s'))
+        print(format('avg queue (ms)', '>16s'), end='')
+        if len(rpc_stats) >= 9:
+            print(format('errors', '>16s'), end='')
+        print()
 
         print(format((ops / sample_time), '>24.3f'), end='')
         print(format((kilobytes / sample_time), '>16.3f'), end='')
@@ -639,7 +647,11 @@ class DeviceData:
         print(format(retransmits, '>16'), end='')
         print(format(rtt_per_op, '>16.3f'), end='')
         print(format(exe_per_op, '>16.3f'), end='')
-        print(format(queued_for_per_op, '>16.3f'))
+        print(format(queued_for_per_op, '>16.3f'), end='')
+        if len(rpc_stats) >= 9:
+            errors = '{0:>10.0f} ({1:>3.1f}%)'.format(errs, errs_percent).strip()
+            print(format(errors, '>16'), end='')
+        print()
 
     def display_iostats(self, sample_time):
         """Display NFS and RPC stats in an iostat-like way
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] nfsiostat: Add error counts to output when RPC iostats version >= 1.1
  2019-06-24 21:16 [PATCH 1/2] nfsiostat: Add error counts to output when RPC iostats version >= 1.1 Dave Wysochanski
  2019-06-24 21:16 ` [PATCH 2/2] mountstats: Add per-op error counts to iostat command " Dave Wysochanski
@ 2019-08-01 16:13 ` Steve Dickson
  1 sibling, 0 replies; 4+ messages in thread
From: Steve Dickson @ 2019-08-01 16:13 UTC (permalink / raw)
  To: Dave Wysochanski, chuck.lever; +Cc: linux-nfs



On 6/24/19 5:16 PM, Dave Wysochanski wrote:
> With RPC iostats 1.1 there is a new metric which counts the RPCs
> completing with errors (tk_status < 0).  Add these to the output at
> the end of the line.  This increases the length of an output line
> to 136 columns from 120, but keeps consistent format and spacing:
> 
> read:              ops/s            kB/s           kB/op         retrans    avg RTT (ms)    avg exe (ms)  avg queue (ms)          errors
>                    0.000           0.106         512.316        0 (0.0%)          17.500          17.500           0.000        0 (0.0%)
> write:             ops/s            kB/s           kB/op         retrans    avg RTT (ms)    avg exe (ms)  avg queue (ms)          errors
>                    0.001           0.476         512.398        0 (0.0%)           1.667           5.778           3.889       1 (11.1%)
> 
> Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Committed.... 

steved.

> ---
>  tools/nfs-iostat/nfs-iostat.py | 17 +++++++++++++++--
>  tools/nfs-iostat/nfsiostat.man |  8 ++++++++
>  2 files changed, 23 insertions(+), 2 deletions(-)
>  mode change 100644 => 100755 tools/nfs-iostat/nfs-iostat.py
> 
> diff --git a/tools/nfs-iostat/nfs-iostat.py b/tools/nfs-iostat/nfs-iostat.py
> old mode 100644
> new mode 100755
> index dec0e861..b7e98a2a
> --- a/tools/nfs-iostat/nfs-iostat.py
> +++ b/tools/nfs-iostat/nfs-iostat.py
> @@ -329,6 +329,8 @@ class DeviceData:
>          queued_for = float(rpc_stats[5])
>          rtt = float(rpc_stats[6])
>          exe = float(rpc_stats[7])
> +        if len(rpc_stats) >= 9:
> +            errs = float(rpc_stats[8])
>  
>          # prevent floating point exceptions
>          if ops != 0:
> @@ -337,12 +339,16 @@ class DeviceData:
>              rtt_per_op = rtt / ops
>              exe_per_op = exe / ops
>              queued_for_per_op = queued_for / ops
> +            if len(rpc_stats) >= 9:
> +                errs_percent = (errs * 100) / ops
>          else:
>              kb_per_op = 0.0
>              retrans_percent = 0.0
>              rtt_per_op = 0.0
>              exe_per_op = 0.0
>              queued_for_per_op = 0.0
> +            if len(rpc_stats) >= 9:
> +                errs_percent = 0.0
>  
>          op += ':'
>          print(format(op.lower(), '<16s'), end='')
> @@ -352,7 +358,10 @@ class DeviceData:
>          print(format('retrans', '>16s'), end='')
>          print(format('avg RTT (ms)', '>16s'), end='')
>          print(format('avg exe (ms)', '>16s'), end='')
> -        print(format('avg queue (ms)', '>16s'))
> +        print(format('avg queue (ms)', '>16s'), end='')
> +        if len(rpc_stats) >= 9:
> +            print(format('errors', '>16s'), end='')
> +        print()
>  
>          print(format((ops / sample_time), '>24.3f'), end='')
>          print(format((kilobytes / sample_time), '>16.3f'), end='')
> @@ -361,7 +370,11 @@ class DeviceData:
>          print(format(retransmits, '>16'), end='')
>          print(format(rtt_per_op, '>16.3f'), end='')
>          print(format(exe_per_op, '>16.3f'), end='')
> -        print(format(queued_for_per_op, '>16.3f'))
> +        print(format(queued_for_per_op, '>16.3f'), end='')
> +        if len(rpc_stats) >= 9:
> +            errors = '{0:>10.0f} ({1:>3.1f}%)'.format(errs, errs_percent).strip()
> +            print(format(errors, '>16'), end='')
> +        print()
>  
>      def ops(self, sample_time):
>          sends = float(self.__rpc_data['rpcsends'])
> diff --git a/tools/nfs-iostat/nfsiostat.man b/tools/nfs-iostat/nfsiostat.man
> index 9ae94c5f..940c0431 100644
> --- a/tools/nfs-iostat/nfsiostat.man
> +++ b/tools/nfs-iostat/nfsiostat.man
> @@ -97,6 +97,14 @@ This is the duration from the time the NFS client created the RPC request task t
>  .RE
>  .RE
>  .RE
> +.RS 8
> +- \fBerrors\fR
> +.RS
> +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.
> +.RS
> +.RE
> +.RE
> +.RE
>  .TP
>  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.
>  
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] mountstats: Add per-op error counts to iostat command when RPC iostats version >= 1.1
  2019-06-24 21:16 ` [PATCH 2/2] mountstats: Add per-op error counts to iostat command " Dave Wysochanski
@ 2019-08-01 16:13   ` Steve Dickson
  0 siblings, 0 replies; 4+ messages in thread
From: Steve Dickson @ 2019-08-01 16:13 UTC (permalink / raw)
  To: Dave Wysochanski, chuck.lever; +Cc: linux-nfs



On 6/24/19 5:16 PM, Dave Wysochanski wrote:
> With RPC iostats 1.1 there is a new metric which counts the RPCs
> completing with errors (tk_status < 0).  Add these to the output at
> the end of the line.  This increases the length of an output line
> to 136 columns from 120, but keeps consistent format and spacing:
> 
> read:              ops/s            kB/s           kB/op         retrans    avg RTT (ms)    avg exe (ms)  avg queue (ms)          errors
>                    0.000           0.106         512.316        0 (0.0%)          17.500          17.500           0.000        0 (0.0%)
> write:             ops/s            kB/s           kB/op         retrans    avg RTT (ms)    avg exe (ms)  avg queue (ms)          errors
>                    0.001           0.476         512.398        0 (0.0%)           1.667           5.778           3.889       1 (11.1%)
> 
> Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Committed... 

steved.
> ---
>  tools/mountstats/mountstats.py | 16 ++++++++++++++--
>  1 file changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/mountstats/mountstats.py b/tools/mountstats/mountstats.py
> index 2f525f4b..c5e8f506 100755
> --- a/tools/mountstats/mountstats.py
> +++ b/tools/mountstats/mountstats.py
> @@ -607,6 +607,8 @@ class DeviceData:
>          queued_for = float(rpc_stats[5])
>          rtt = float(rpc_stats[6])
>          exe = float(rpc_stats[7])
> +        if len(rpc_stats) >= 9:
> +            errs = int(rpc_stats[8])
>  
>          # prevent floating point exceptions
>          if ops != 0:
> @@ -615,12 +617,15 @@ class DeviceData:
>              rtt_per_op = rtt / ops
>              exe_per_op = exe / ops
>              queued_for_per_op = queued_for / ops
> +            if len(rpc_stats) >= 9:
> +                errs_percent = (errs * 100) / ops
>          else:
>              kb_per_op = 0.0
>              retrans_percent = 0.0
>              rtt_per_op = 0.0
>              exe_per_op = 0.0
>              queued_for_per_op = 0.0
> +            errs_percent = 0.0
>  
>          op += ':'
>          print(format(op.lower(), '<16s'), end='')
> @@ -630,7 +635,10 @@ class DeviceData:
>          print(format('retrans', '>16s'), end='')
>          print(format('avg RTT (ms)', '>16s'), end='')
>          print(format('avg exe (ms)', '>16s'), end='')
> -        print(format('avg queue (ms)', '>16s'))
> +        print(format('avg queue (ms)', '>16s'), end='')
> +        if len(rpc_stats) >= 9:
> +            print(format('errors', '>16s'), end='')
> +        print()
>  
>          print(format((ops / sample_time), '>24.3f'), end='')
>          print(format((kilobytes / sample_time), '>16.3f'), end='')
> @@ -639,7 +647,11 @@ class DeviceData:
>          print(format(retransmits, '>16'), end='')
>          print(format(rtt_per_op, '>16.3f'), end='')
>          print(format(exe_per_op, '>16.3f'), end='')
> -        print(format(queued_for_per_op, '>16.3f'))
> +        print(format(queued_for_per_op, '>16.3f'), end='')
> +        if len(rpc_stats) >= 9:
> +            errors = '{0:>10.0f} ({1:>3.1f}%)'.format(errs, errs_percent).strip()
> +            print(format(errors, '>16'), end='')
> +        print()
>  
>      def display_iostats(self, sample_time):
>          """Display NFS and RPC stats in an iostat-like way
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-08-01 16:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-24 21:16 [PATCH 1/2] nfsiostat: Add error counts to output when RPC iostats version >= 1.1 Dave Wysochanski
2019-06-24 21:16 ` [PATCH 2/2] mountstats: Add per-op error counts to iostat command " Dave Wysochanski
2019-08-01 16:13   ` Steve Dickson
2019-08-01 16:13 ` [PATCH 1/2] nfsiostat: Add error counts to output " Steve Dickson

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.