Skip to contentSkip to conversation

nfsiostat: periodically flush stdout

PATCH In review Harshula Jayasuriya 2 participants 2 messages Sep 9, 2013 – Sep 18, 2013

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

PATCH 1/1 nfsiostat: periodically flush stdout

* In a shell script, when nfsiostat is run in the background with stdout redirected to a file, flush stdout periodically to ensure that we do not lose the buffered output if the nfsiostat process is killed.

---
 tools/nfs-iostat/nfs-iostat.py | 2 ++
 1 file changed, 2 insertions(+)
tools/nfs-iostat/nfs-iostat.py +2 -0
index c035537..155581c 100644
@@ -413,6 +413,8 @@ class DeviceData:
             self.__print_rpc_op_stats('WRITE', sample_time)
             self.__print_page_stats(sample_time)
 
+        sys.stdout.flush()
+
 #
 # Functions
 #
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 6 lines · Harshula Jayasuriya

* In a shell script, when nfsiostat is run in the background with stdout redirected to a file, flush stdout periodically to ensure that we do not lose the buffered output if the nfsiostat process is killed.

Committed!

steved.

Quoted 18 lines
---
 tools/nfs-iostat/nfs-iostat.py | 2 ++
 1 file changed, 2 insertions(+)
tools/nfs-iostat/nfs-iostat.py +2 -0
index c035537..155581c 100644
@@ -413,6 +413,8 @@ class DeviceData:
             self.__print_rpc_op_stats('WRITE', sample_time)
             self.__print_page_stats(sample_time)
 
+        sys.stdout.flush()
+
 #
 # Functions
 #