Skip to content

Instantly share code, notes, and snippets.

@lewg
Created August 9, 2012 12:53
Show Gist options
  • Save lewg/3303938 to your computer and use it in GitHub Desktop.
Save lewg/3303938 to your computer and use it in GitHub Desktop.
Mock graphite server. Just spits out what it gets.
require 'socket'
require 'thread'
@mock_graphite = TCPServer.new 2003
loop do
client = @mock_graphite.accept
data = ""
recv_length = 100
while (tmp = client.recv(recv_length))
data += tmp
break if tmp.empty?
end
puts data
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment