From: Steve Dickson <SteveD@redhat.com>
To: Chuck Lever <chuck.lever@oracle.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 2/2] nfs-iostat: Fix attribute cache statistics
Date: Wed, 30 Apr 2014 12:31:13 -0400 [thread overview]
Message-ID: <53612551.8070509@RedHat.com> (raw)
In-Reply-To: <20140425165220.30699.79542.stgit@manet.1015granger.net>
On 04/25/2014 12:52 PM, Chuck Lever wrote:
> "nfs-iostat.py --attr" was displaying nonsense (like negative
> counts and percentages).
>
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Committed...
steved.
> ---
>
> tools/nfs-iostat/nfs-iostat.py | 28 ++++++++--------------------
> 1 files changed, 8 insertions(+), 20 deletions(-)
>
> diff --git a/tools/nfs-iostat/nfs-iostat.py b/tools/nfs-iostat/nfs-iostat.py
> index 6831c12..b324cd8 100644
> --- a/tools/nfs-iostat/nfs-iostat.py
> +++ b/tools/nfs-iostat/nfs-iostat.py
> @@ -243,27 +243,15 @@ class DeviceData:
> """Print attribute cache efficiency stats
> """
> nfs_stats = self.__nfs_data
> - getattr_stats = self.__rpc_data['GETATTR']
> -
> - if nfs_stats['inoderevalidates'] != 0:
> - getattr_ops = float(getattr_stats[1])
> - opens = float(nfs_stats['vfsopen'])
> - revalidates = float(nfs_stats['inoderevalidates']) - opens
> - if revalidates != 0:
> - ratio = ((revalidates - getattr_ops) * 100) / revalidates
> - else:
> - ratio = 0.0
> -
> - data_invalidates = float(nfs_stats['datainvalidates'])
> - attr_invalidates = float(nfs_stats['attrinvalidates'])
>
> - print()
> - print('%d inode revalidations, hitting in cache %4.2f%% of the time' % \
> - (revalidates, ratio))
> - print('%d open operations (mandatory GETATTR requests)' % opens)
> - if getattr_ops != 0:
> - print('%4.2f%% of GETATTRs resulted in data cache invalidations' % \
> - ((data_invalidates * 100) / getattr_ops))
> + print()
> + print('%d VFS opens' % (nfs_stats['vfsopen']))
> + print('%d inoderevalidates (forced GETATTRs)' % \
> + (nfs_stats['inoderevalidates']))
> + print('%d page cache invalidations' % \
> + (nfs_stats['datainvalidates']))
> + print('%d attribute cache invalidations' % \
> + (nfs_stats['attrinvalidates']))
>
> def __print_dir_cache_stats(self, sample_time):
> """Print directory stats
>
next prev parent reply other threads:[~2014-04-30 16:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-25 16:52 [PATCH 1/2] nfs-iostat: Fix columnarization of RPC statistics Chuck Lever
2014-04-25 16:52 ` [PATCH 2/2] nfs-iostat: Fix attribute cache statistics Chuck Lever
2014-04-30 16:31 ` Steve Dickson [this message]
2014-04-30 16:30 ` [PATCH 1/2] nfs-iostat: Fix columnarization of RPC statistics Steve Dickson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=53612551.8070509@RedHat.com \
--to=steved@redhat.com \
--cc=chuck.lever@oracle.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.