Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
executable file 25 lines (21 sloc) 566 Bytes
#!/usr/bin/env ruby
# Script to profile thin using ruby-prof.
# Takes the same arguments as the thin script.
require 'rubygems'
require 'ruby-prof'
$: << File.join(File.dirname(__FILE__), '..', 'lib')
require 'thin'
class Adapter
def call(env)
[200, {'Content-Type' => 'text/html', 'Content-Length' => '11'}, ['hello world']]
end
end
# Profile the code
result = RubyProf.profile do
Thin::Server.start('0.0.0.0', 3000) do
run Adapter.new
end
end
# Print a graph profile to text
printer = RubyProf::GraphPrinter.new(result)
printer.print(STDOUT, 0)
Jump to Line
Something went wrong with that request. Please try again.