vmpooler/lib/graphite.rb
Scott Schneider 3239ea29bd Send graphite data from within a thread
...so that if it fails, it doesn't kill our whole processing thread
2013-11-13 13:31:17 -08:00

18 lines
293 B
Ruby
Executable file

require 'rubygems' unless defined?(Gem)
class Graphite
def initialize(
s = 'graphite'
)
@server = s
end
def log path, value
Thread.new {
socket = TCPSocket.new(@server, 2003)
socket.puts "#{path} #{value} #{Time.now.to_i}"
socket.close
}
end
end