Created
August 9, 2012 12:53
-
-
Save lewg/3303938 to your computer and use it in GitHub Desktop.
Mock graphite server. Just spits out what it gets.
This file contains 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
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