Skip to content

Commit

Permalink
Merge pull request #11 from TJM/issue-6
Browse files Browse the repository at this point in the history
Issue #6 - ReadDirPlus doesn't work on NFSv4 mounts
  • Loading branch information
Tommy McNeely committed Nov 5, 2014
2 parents b11c9b2 + fc55405 commit be4820e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/nfsiostat.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,8 @@ def backlog(self, sample_time):
return (float(self.__rpc_data['backlogutil']) / sends) / sample_time
else:
return 0.0
def has_readdirplus(self):
return self.__rpc_data.has_key('READDIRPLUS')

def display_iostats(self, sample_time, which):
"""Display NFS and RPC stats in an iostat-like way
Expand Down
5 changes: 4 additions & 1 deletion src/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def _parse_config(self):
self.logger.info("Configured to use proxy: %s:%s" % (proxy_host, proxy_port))
# Initialize NFS related values
self.nfs_device_list = json.loads(config.get('nfs','device_list'))
self.nfs_ops = ['Read','Write','GetAttr','Access','Lookup','ReadDir']
self.nfs_ops = ['Read','Write','GetAttr','Access','Lookup','ReadDir','ReadDirPlus']

except Exception, e:
self.logger.exception(e)
Expand Down Expand Up @@ -182,6 +182,9 @@ def _get_nfs_stat_for(self, volume, prefix='Component/NFS/Volume'):
}

for op in (self.nfs_ops):
if op.upper() is 'READDIRPLUS' and not volnfsstat.has_readdirplus():
# NFSv4 mounts do not have READDIRPLUS
continue
op_stat = volnfsstat.get_rpc_op_stats(op.upper(), self.duration)
op_prefix = prefix + op
op_data = {
Expand Down

0 comments on commit be4820e

Please sign in to comment.