Created
September 7, 2012 03:55
-
-
Save jugyo/3662942 to your computer and use it in GitHub Desktop.
getting profile for rails
This file contains hidden or 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
| def prof(&block) | |
| result = RubyProf.profile(&block) | |
| filename = "result-#{Time.now.to_i}.html" | |
| File.open(filename, 'w') do |file| | |
| RubyProf::FlatPrinter.new(result).print(file, :min_percent => 1) | |
| end | |
| puts "=> #{filename}" | |
| end | |
| # Load the rails application | |
| require File.expand_path('../application', __FILE__) | |
| prof do | |
| # Initialize the rails application | |
| Rails3Profile::Application.initialize! | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment