lib/deputy.rb in deputy-0.1.24 vs lib/deputy.rb in deputy-0.1.25
- old
+ new
@@ -112,11 +112,13 @@
send_report "Deputies.Error", e.message
raise e
end
def self.send_report(metric, value)
- raise "Use with dot e.g. Mysql.status" if metric.split('.',2).size != 2
- get "/report/#{CGI.escape metric}?value=#{CGI.escape value.to_s}"
+ # TODO sheriff does not accept anything else, fix it...
+ metric = metric.split('.',2)
+ metric = metric.map{|m| m.gsub(/[^-_a-zA-Z]/, '_') } * '.'
+ get "/report/#{metric}?value=#{CGI.escape value.to_s}"
end
def self.get(path)
url = "#{sheriff_url}#{path}"
Timeout.timeout(1) do
\ No newline at end of file