Skip to contentSkip to conversation

nfsiostat: display READ_PLUS statistics when available

PATCH In review Karim Manaouil 2 participants 2 messages Sep 29 – Nov 7

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

PATCH 1/1 nfsiostat: display READ_PLUS statistics when available

NFSv4.2 mounts may report READ_PLUS operations separately from READ in /proc/self/mountstats. nfsiostat parses these counters but does not display them, leaving read activity out of its reports.

Display READ_PLUS in the default and page cache reports when the operation is present. Document the conditional output.

---
 tools/nfs-iostat/nfs-iostat.py | 4 ++++
 tools/nfs-iostat/nfsiostat.man | 5 ++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
tools/nfs-iostat/nfs-iostat.py +4 -0
index af04aac5..2a681bbe 100755
@@ -436,6 +436,8 @@ class DeviceData:
 
         if which == 0:
             self.__print_rpc_op_stats('READ', sample_time, use_mb)
+            if 'READ_PLUS' in self.__rpc_data:
+                self.__print_rpc_op_stats('READ_PLUS', sample_time, use_mb)
             self.__print_rpc_op_stats('WRITE', sample_time, use_mb)
         elif which == 1:
             self.__print_rpc_op_stats('GETATTR', sample_time, use_mb)
@@ -449,6 +451,8 @@ class DeviceData:
             self.__print_dir_cache_stats(sample_time)
         elif which == 3:
             self.__print_rpc_op_stats('READ', sample_time, use_mb)
+            if 'READ_PLUS' in self.__rpc_data:
+                self.__print_rpc_op_stats('READ_PLUS', sample_time, use_mb)
             self.__print_rpc_op_stats('WRITE', sample_time, use_mb)
             self.__print_page_stats(sample_time)
 
tools/nfs-iostat/nfsiostat.man +4 -1
index 4f24318d..b06e65aa 100644
@@ -10,6 +10,8 @@ nfsiostat \- Emulate iostat for NFS mount points using /proc/self/mountstats
 The
 .B nfsiostat
 command displays NFS client per-mount statistics. 
+The default report displays READ and WRITE statistics.  It also displays
+READ_PLUS when it is present in /proc/self/mountstats.
 .TP 
 <interval>
 specifies the amount of time in seconds between each report.
@@ -126,7 +128,8 @@ only print stats for first LIST mount points
 display throughput in megabytes per second
 .TP
 .B \-p " or " \-\-page
-displays statistics related to the page cache
+displays statistics related to the page cache, including READ_PLUS
+when it is present in /proc/self/mountstats
 .TP
 .B \-s " or " \-\-sort
 Sort NFS mount points by ops/second
Signature · 5 lines
2.47.3


-- 
~karim
#1 lore raw
Quoted 8 lines · Karim Manaouil

NFSv4.2 mounts may report READ_PLUS operations separately from READ in /proc/self/mountstats. nfsiostat parses these counters but does not display them, leaving read activity out of its reports.

Display READ_PLUS in the default and page cache reports when the operation is present. Document the conditional output.

Committed... (tag: nfs-utils-3-1-2.rc1

steved.> ---

Quoted 49 lines
  tools/nfs-iostat/nfs-iostat.py | 4 ++++
  tools/nfs-iostat/nfsiostat.man | 5 ++++-
  2 files changed, 8 insertions(+), 1 deletion(-)
tools/nfs-iostat/nfs-iostat.py +4 -0
index af04aac5..2a681bbe 100755
@@ -436,6 +436,8 @@ class DeviceData:
 
          if which == 0:
              self.__print_rpc_op_stats('READ', sample_time, use_mb)
+            if 'READ_PLUS' in self.__rpc_data:
+                self.__print_rpc_op_stats('READ_PLUS', sample_time, use_mb)
              self.__print_rpc_op_stats('WRITE', sample_time, use_mb)
          elif which == 1:
              self.__print_rpc_op_stats('GETATTR', sample_time, use_mb)
@@ -449,6 +451,8 @@ class DeviceData:
              self.__print_dir_cache_stats(sample_time)
          elif which == 3:
              self.__print_rpc_op_stats('READ', sample_time, use_mb)
+            if 'READ_PLUS' in self.__rpc_data:
+                self.__print_rpc_op_stats('READ_PLUS', sample_time, use_mb)
              self.__print_rpc_op_stats('WRITE', sample_time, use_mb)
              self.__print_page_stats(sample_time)
 
tools/nfs-iostat/nfsiostat.man +4 -1
index 4f24318d..b06e65aa 100644
@@ -10,6 +10,8 @@ nfsiostat \- Emulate iostat for NFS mount points using /proc/self/mountstats
  The
  .B nfsiostat
  command displays NFS client per-mount statistics.
+The default report displays READ and WRITE statistics.  It also displays
+READ_PLUS when it is present in /proc/self/mountstats.
  .TP
  <interval>
  specifies the amount of time in seconds between each report.
@@ -126,7 +128,8 @@ only print stats for first LIST mount points
  display throughput in megabytes per second
  .TP
  .B \-p " or " \-\-page
-displays statistics related to the page cache
+displays statistics related to the page cache, including READ_PLUS
+when it is present in /proc/self/mountstats
  .TP
  .B \-s " or " \-\-sort
  Sort NFS mount points by ops/second