Skip to content

Instantly share code, notes, and snippets.

@skateinmars
Created July 8, 2019 08:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skateinmars/950cef8aaf47e893489ba3a44b674c4e to your computer and use it in GitHub Desktop.
Save skateinmars/950cef8aaf47e893489ba3a44b674c4e to your computer and use it in GitHub Desktop.
Fake Statsd ruby server
#!/usr/bin/env ruby
#
# vim: set ft=ruby
#
require 'rubygems'
require 'socket'
$stdout.sync = true
s = UDPSocket.new
s.bind(nil, 8125)
while blob = s.recvfrom(1024)
puts "StatsD Metric: #{blob.first}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment