Skip to content

Instantly share code, notes, and snippets.

@parolkar
Created January 30, 2012 07:45
Show Gist options
  • Save parolkar/1703097 to your computer and use it in GitHub Desktop.
Save parolkar/1703097 to your computer and use it in GitHub Desktop.
Handy script to help analyse heroku dyno behaviour [CEDAR STACK]
available_signals = Signal.list
f = STDERR
f.puts "Arguments to the process \n #{ARGV.inspect} \n\n"
f.puts "Environment of the process \n #{ENV.inspect} \n\n"
f.puts "Available Signals: #{available_signals.keys.inspect}"
f.flush
available_signals.keys.each do |signal|
eval("
trap :#{signal} do
f.puts \"SIG#{signal} trapped at #{Time.now}\"
f.flush
end
");
end
loop do
#something
end
#run lambda { |env| [200, {'Content-Type'=>'text/plain'}, StringIO.new("Analysis App\n")] }
web: ruby dyno_process_analyse.rb -p $PORT
worker: ruby dyno_process_analyse.rb -p $PORT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment