]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
nfs-iostat.py: don't wait for an extra interval when given a count
authorDavid Lecorfe <dlecorfec@gmail.com>
Mon, 27 Sep 2010 17:29:31 +0000 (13:29 -0400)
committerSteve Dickson <steved@redhat.com>
Mon, 27 Sep 2010 17:29:31 +0000 (13:29 -0400)
If I invoke the tool with an interval of 10 and a count of 2, it will:
- show the summary
- sleep 10s
- show the stats for the last 10s
- sleep 10s
- exit

Signed-off-by: David Lecorfe <dlecorfec@gmail.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
tools/nfs-iostat/nfs-iostat.py

index 1207674e4ad7c19b95fbddfe0de7931708015856..124237910407d332d4e43678c32799652596613a 100644 (file)
@@ -601,7 +601,8 @@ client are listed.
         while count != 0:
             print_iostat_summary(old_mountstats, mountstats, devices, sample_time, options)
             old_mountstats = mountstats
-            time.sleep(interval)
+                       if count != 1:
+               time.sleep(interval)
             sample_time = interval
             mountstats = parse_stats_file('/proc/self/mountstats')
             # automount mountpoints add and drop, if automount is involved