sends = float(self.__rpc_data['rpcsends'])
if sample_time == 0:
sample_time = float(self.__nfs_data['age'])
+ # sample_time could still be zero if the export was just mounted.
+ # Set it to 1 to avoid divide by zero errors in this case since we'll
+ # likely still have relevant mount statistics to show.
+ #
+ if sample_time == 0:
+ sample_time = 1;
if sends != 0:
backlog = (float(self.__rpc_data['backlogutil']) / sends) / sample_time
else:
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