diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-14 08:23:50 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-14 08:23:50 +0000 |
commit | 624d5bb176de5212bea43a1c57a95f48676c6e9f (patch) | |
tree | 9bba432db896b085abe9e233dc037312cea197cf /railties/bin/profiler | |
parent | 75b8ac80d988c39e48966d6b60f0d1d46c0d75a6 (diff) | |
download | rails-624d5bb176de5212bea43a1c57a95f48676c6e9f.tar.gz rails-624d5bb176de5212bea43a1c57a95f48676c6e9f.tar.bz2 rails-624d5bb176de5212bea43a1c57a95f48676c6e9f.zip |
Added script/benchmarker to easily benchmark one or more statement a number of times from within the environment. Added script/profiler to easily profile a single statement from within the environment
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1166 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/bin/profiler')
-rw-r--r-- | railties/bin/profiler | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/railties/bin/profiler b/railties/bin/profiler new file mode 100644 index 0000000000..aca84055c2 --- /dev/null +++ b/railties/bin/profiler @@ -0,0 +1,14 @@ +#!/usr/local/bin/ruby + +if ARGV.empty? + puts "Usage: profiler 'Person.expensive_method(10)' [times]" + exit +end + +require File.dirname(__FILE__) + '/../config/environment' +require "profiler" + +Profiler__::start_profile +(ARGV[1] || 1).to_i.times { eval(ARGV.first) } +Profiler__::stop_profile +Profiler__::print_profile($stdout)
\ No newline at end of file |