Skip to content

Instantly share code, notes, and snippets.

@mikehale
Last active December 17, 2015 07:09
Show Gist options
  • Save mikehale/5570251 to your computer and use it in GitHub Desktop.
Save mikehale/5570251 to your computer and use it in GitHub Desktop.
gem 'raindrops'
before_fork do |server, worker|
require 'raindrops'
Thread.new do
begin
socket = "0.0.0.0:#{ENV['PORT']}"
stats = Raindrops::Linux.tcp_listener_stats([socket])[socket]
STDOUT.sync = true
puts "raindrops socket=#{socket} active=#{stats.active} queued=#{stats.queued}\n"
end while sleep(1)
end if defined?(Raindrops::Linux) and ENV['RAINDROPS_STATS_ENABLED']
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment