Created
March 12, 2013 09:55
-
-
Save octplane/5141659 to your computer and use it in GitHub Desktop.
How to talk to graphite.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
send_graphite("munin5.mysql.slow_count %.5f %d" % [@slow_count.to_f/@interval, Time.now.to_i]) | |
def send_graphite(message) | |
hostname = 'graphite' | |
port = 2003 | |
begin | |
s = TCPSocket.open(hostname, port) | |
s.puts(message) | |
s.close | |
rescue Exception => e | |
puts "Exception #{e} while sending \"#{message}\" to graphite" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment