Linux-NFS Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v3] mountstats: Adding 'Day, Hour:Min:Sec' to "mountstats --nfs" for ease of understanding.
@ 2020-06-05 14:48 Rohan Sable
  2020-06-18 17:09 ` Steve Dickson
  0 siblings, 1 reply; 2+ messages in thread
From: Rohan Sable @ 2020-06-05 14:48 UTC (permalink / raw)
  To: linux-nfs; +Cc: rsable, steved, smayhew, chuck.lever

This patch adds printing of 'Days, Hours:Mins:Sec' like below to --nfs in mountstats :
NFS mount age : 12 days, 23:59:59

Signed-off-by: Rohan Sable <rsable@redhat.com>
---
 tools/mountstats/mountstats.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/mountstats/mountstats.py b/tools/mountstats/mountstats.py
index d565385d..014f38a3 100755
--- a/tools/mountstats/mountstats.py
+++ b/tools/mountstats/mountstats.py
@@ -4,6 +4,7 @@
 """
 
 from __future__ import print_function
+import datetime as datetime
 
 __copyright__ = """
 Copyright (C) 2005, Chuck Lever <cel@netapp.com>
@@ -391,6 +392,7 @@ class DeviceData:
         """Pretty-print the NFS options
         """
         print('  NFS mount options: %s' % ','.join(self.__nfs_data['mountoptions']))
+        print('  NFS mount age: %s' % datetime.timedelta(seconds = self.__nfs_data['age']))
         print('  NFS server capabilities: %s' % ','.join(self.__nfs_data['servercapabilities']))
         if 'nfsv4flags' in self.__nfs_data:
             print('  NFSv4 capability flags: %s' % ','.join(self.__nfs_data['nfsv4flags']))
-- 
2.25.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v3] mountstats: Adding 'Day, Hour:Min:Sec' to "mountstats --nfs" for ease of understanding.
  2020-06-05 14:48 [PATCH v3] mountstats: Adding 'Day, Hour:Min:Sec' to "mountstats --nfs" for ease of understanding Rohan Sable
@ 2020-06-18 17:09 ` Steve Dickson
  0 siblings, 0 replies; 2+ messages in thread
From: Steve Dickson @ 2020-06-18 17:09 UTC (permalink / raw)
  To: Rohan Sable, linux-nfs; +Cc: smayhew, chuck.lever



On 6/5/20 10:48 AM, Rohan Sable wrote:
> This patch adds printing of 'Days, Hours:Mins:Sec' like below to --nfs in mountstats :
> NFS mount age : 12 days, 23:59:59
> 
> Signed-off-by: Rohan Sable <rsable@redhat.com>
Committed.... 

steved.
> ---
>  tools/mountstats/mountstats.py | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tools/mountstats/mountstats.py b/tools/mountstats/mountstats.py
> index d565385d..014f38a3 100755
> --- a/tools/mountstats/mountstats.py
> +++ b/tools/mountstats/mountstats.py
> @@ -4,6 +4,7 @@
>  """
>  
>  from __future__ import print_function
> +import datetime as datetime
>  
>  __copyright__ = """
>  Copyright (C) 2005, Chuck Lever <cel@netapp.com>
> @@ -391,6 +392,7 @@ class DeviceData:
>          """Pretty-print the NFS options
>          """
>          print('  NFS mount options: %s' % ','.join(self.__nfs_data['mountoptions']))
> +        print('  NFS mount age: %s' % datetime.timedelta(seconds = self.__nfs_data['age']))
>          print('  NFS server capabilities: %s' % ','.join(self.__nfs_data['servercapabilities']))
>          if 'nfsv4flags' in self.__nfs_data:
>              print('  NFSv4 capability flags: %s' % ','.join(self.__nfs_data['nfsv4flags']))
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-05 14:48 [PATCH v3] mountstats: Adding 'Day, Hour:Min:Sec' to "mountstats --nfs" for ease of understanding Rohan Sable
2020-06-18 17:09 ` Steve Dickson

Linux-NFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nfs/0 linux-nfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nfs linux-nfs/ https://lore.kernel.org/linux-nfs \
		linux-nfs@vger.kernel.org
	public-inbox-index linux-nfs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-nfs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git