bin/metrics-cassandra-graphite.rb in sensu-plugins-cassandra-0.0.3 vs bin/metrics-cassandra-graphite.rb in sensu-plugins-cassandra-0.0.4
- old
+ new
@@ -316,12 +316,12 @@
# Compacted row mean size: 0
#
# some notes on parsing cfstats output:
# - a line preceeded by 1 tab contains keyspace metrics
# - a line preceeded by 2 tabs contains column family metrics
- def parse_cfstats# rubocop:disable all
- def get_metric(string)
+ def parse_cfstats
+ def get_metric(string) # rubocop:disable NestedMethodDefinition
string.strip!
(metric, value) = string.split(': ')
if metric.nil? || value.nil?
return [nil, nil]
else
@@ -352,10 +352,10 @@
cf = nil
elsif num_indents == 2 && !cf.nil?
# a column family metric
# #YELLOW
if config[:filter_regex]
- unless cf.match(config[:filter_regex]) # rubocop:disable IfUnlessModifier
+ unless cf.match(config[:filter_regex])
next
end
end
(metric, value) = get_metric(line)
output "#{config[:scheme]}.#{keyspace}.#{cf}.#{metric}", value, @timestamp unless value == 'disabled'