Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2214192ybm; Thu, 23 May 2019 13:14:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxF5pkF7H5e8GYFZJgxSJjszKnh0PbjXfYHMW1djtyUnCBXuc/AovbgzFIudqQL9FCaDlMk X-Received: by 2002:a17:90a:617:: with SMTP id j23mr3780218pjj.111.1558642475112; Thu, 23 May 2019 13:14:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558642475; cv=none; d=google.com; s=arc-20160816; b=WcEC51Ff9AU8L2wDQVI8dON9Qsq5CYq6j6GatfqR1lzt/B96kXbjbKvAVdkAILe5+Z IOWLb36OqsVMIQGTMOm6YwnBlZayGeva3eeqKxFvduNEYbdKmzJE6io02eLY36NybN+I DL81GpaRjE32dcTOzDudcJX06dd0SF1N3Lo2vK5xM8bG2D2OoQfLf16P2IX4jsU+uc3Y pGLfncwGMd3iGz8ncV4ut8fP8tBGS4nIuosBYYy2DF5eBJ3hXeZ0f2H0gk1UpQiFrAfM eM+DNlajDLMlMlquWlvkrFv5m3xe6JFrHVTleP3d1IXXvqOUQlV33CUJt5aMa/xKnAmr zpmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from; bh=ik2ysgLfjgkg+ekSK9aeJd56A9LVijBwJIbsMvGxNno=; b=ns+jc04ZRs748CgBAOIxPtYbAtYuJM44bsS+VvR0OcycNFPEE5Zo4PbYLcHJ8EgJzR LZNMDZs/kngd12Zrlfx4dLPZDjCdFMxKCBXmqYHduN0hXNA3SD9bm+qP99qo1iTlDsLu SH8/E2h3QGSMX5GuXU0vd8pEw87LFl+gQamhOXV6WluVcRbIsppLeOCkiU+VHIdD/hZS T8J6M8iAqYHySFQnxsGbc6zuFWS2qqtH2iaWOIVt1Y8OYWZpr6qP4wLveeH//V0djBGW 59w7v77n0nGdV9bpCcWwbJ65OZEpBED4KEG26IUHU0hNZWdHAaSmjs4cNKrIRfCB4E0C aU2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z8si512908pjq.89.2019.05.23.13.14.10; Thu, 23 May 2019 13:14:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387492AbfEWUOH (ORCPT + 99 others); Thu, 23 May 2019 16:14:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48860 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387436AbfEWUOH (ORCPT ); Thu, 23 May 2019 16:14:07 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A4BDB821F3 for ; Thu, 23 May 2019 20:14:07 +0000 (UTC) Received: from f29-node1.dwysocha.net (dhcp145-42.rdu.redhat.com [10.13.145.42]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7A9A76012C for ; Thu, 23 May 2019 20:14:07 +0000 (UTC) From: Dave Wysochanski To: linux-nfs@vger.kernel.org Subject: [PATCH] mountstats: add per-op error counts for mountstats command Date: Thu, 23 May 2019 16:13:51 -0400 Message-Id: <20190523201351.12232-4-dwysocha@redhat.com> In-Reply-To: <20190523201351.12232-1-dwysocha@redhat.com> References: <20190523201351.12232-1-dwysocha@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 23 May 2019 20:14:07 +0000 (UTC) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Display the count of ops completing with error status (status < 0) on kernels that support it. Signed-off-by: Dave Wysochanski --- tools/mountstats/mountstats.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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' % \ -- 2.20.1