Message ID | 20190523201351.12232-4-dwysocha@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | mountstats: add per-op error counts for mountstats command | expand |
diff --git a/tools/mountstats/mountstats.py b/tools/mountstats/mountstats.py index c7fb8bb1..b8c720d5 100755 --- a/tools/mountstats/mountstats.py +++ b/tools/mountstats/mountstats.py @@ -475,7 +475,9 @@ class DeviceData: retrans = stats[2] - count if retrans != 0: print('\t%d retrans (%d%%)' % (retrans, ((retrans * 100) / count)), end=' ') - print('\t%d major timeouts' % stats[3]) + print('\t%d major timeouts' % stats[3], end='') + if len(stats) >= 10 and stats[9] != 0: + print('%d errors (%d%%)' % (stats[9], ((stats[9] * 100) / count))) else: print('') print('\tavg bytes sent per op: %d\tavg bytes received per op: %d' % \
Display the count of ops completing with error status (status < 0) on kernels that support it. Signed-off-by: Dave Wysochanski <dwysocha@redhat.com> --- tools/mountstats/mountstats.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)