Skip to content

Instantly share code, notes, and snippets.

@saadullahsaeed
Created June 4, 2012 19:53
Show Gist options
  • Save saadullahsaeed/2870471 to your computer and use it in GitHub Desktop.
Save saadullahsaeed/2870471 to your computer and use it in GitHub Desktop.
Ruby: Send metric to carbon
require 'socket'
host = '127.0.0.1'
port = 2003
socket = TCPSocket::new(host, port)
socket.puts("system.loadavg_1min 2.0 #{Time.now.to_i}\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment