Permalink
Browse files

Update lib/graphite/logger.rb

Ignore non-numeric metrics
  • Loading branch information...
1 parent f4665c0 commit 9063ba8434c401ec1b99a502240b7f495f6d724f @shock shock committed Nov 5, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/graphite/logger.rb
View
@@ -29,7 +29,7 @@ def socket
def log(time, measurements)
message = ""
measurements.each do |key, value|
- raise "Measurement is not numeric" unless value.respond_to? :to_f
+ next unless value.respond_to? :to_f
message << "#{key} #{value.to_f} #{time.to_i}\n"
end
logger.info("Graphite: #{message}") if logger

0 comments on commit 9063ba8

Please sign in to comment.