Skip to content

Commit

Permalink
ceph_latency_plugin: suport yet another rados bench format. This is a
Browse files Browse the repository at this point in the history
fast hack, should be fixed to be not ugly later.
  • Loading branch information
grin authored and grin committed Nov 25, 2016
1 parent f0527c3 commit 5024baa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions plugins/ceph_latency_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,13 @@ def get_stats(self):
results = regex_match.findall(output)

if len(results) == 0:
collectd.error('ceph-latency: failed to run rados bench :: output unrecognized %s' % output)
return
# this is a fast hack, should put regexps into an array and try 'em all
regex_match = re.compile('^([a-zA-Z]+) [lL]atency: +(\w+.?\w+)', re.MULTILINE)
results = regex_match.findall(output)
if len(results) == 0:
# hopeless
collectd.error('ceph-latency: failed to run rados bench :: output unrecognized %s' % output)
return

data[ceph_cluster]['cluster'] = {}
for key, value in results:
Expand Down

2 comments on commit 5024baa

@Kallio
Copy link

@Kallio Kallio commented on 5024baa Nov 28, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if you just replace regex_match from line 66
with this
regex_match = re.compile('^([a-zA-Z]+) [lL]atency: +(\w+.?\w+)', re.MULTILINE)

At least it "fixed" my check with hammer ceph

@grinapo
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kallio The original wasn't created by me so I do not understand what (why) it wanted to achieve. Possibly worked on a different version of rados, but I don't have the time to check half a dozen ones. I don't want to break it for other people without careful inspection.

Please sign in to comment.