aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides
diff options
context:
space:
mode:
authorGonçalo Silva <goncalossilva@gmail.com>2011-05-10 02:33:01 +0100
committerGonçalo Silva <goncalossilva@gmail.com>2011-05-10 02:33:01 +0100
commitdcc99e23cddab727fec2f7026bc30be18b07cee0 (patch)
tree0cc89d4c3eb05fea84f2e6a7d3aa466207ba3e45 /railties/guides
parent9ca97a6baf1e75c3ef4b69a993e6713b88c09e61 (diff)
downloadrails-dcc99e23cddab727fec2f7026bc30be18b07cee0.tar.gz
rails-dcc99e23cddab727fec2f7026bc30be18b07cee0.tar.bz2
rails-dcc99e23cddab727fec2f7026bc30be18b07cee0.zip
benchmarker and profiler now use the new performance testing tools (support for Rubinius and JRuby and high configurability)
Diffstat (limited to 'railties/guides')
-rw-r--r--railties/guides/source/performance_testing.textile50
1 files changed, 21 insertions, 29 deletions
diff --git a/railties/guides/source/performance_testing.textile b/railties/guides/source/performance_testing.textile
index bbf200e66f..0f49bffdf7 100644
--- a/railties/guides/source/performance_testing.textile
+++ b/railties/guides/source/performance_testing.textile
@@ -458,55 +458,47 @@ Writing performance test cases could be an overkill when you are looking for one
h4. +benchmarker+
-+benchmarker+ is a wrapper around Ruby's "Benchmark":http://ruby-doc.org/core/classes/Benchmark.html standard library.
-
Usage:
<shell>
-$ rails benchmarker [times] 'Person.expensive_way' 'Person.another_expensive_way' ...
+Usage: rails benchmarker 'Ruby.code' 'Ruby.more_code' ... [OPTS]
+ -r, --runs N Number of runs.
+ Default: 4
+ -o, --output PATH Directory to use when writing the results.
+ Default: tmp/performance
+ -m, --metrics a,b,c Metrics to use.
+ Default: wall_time,memory,objects,gc_runs,gc_time
</shell>
-Examples:
+Example:
<shell>
-$ rails benchmarker 10 'Item.all' 'CouchItem.all'
-</shell>
-
-If the +[times]+ argument is omitted, supplied methods are run just once:
-
-<shell>
-$ rails benchmarker 'Item.first' 'Item.last'
+$ rails benchmarker 'Item.all' 'CouchItem.all' --runs 3 --metrics wall_time,memory
</shell>
h4. +profiler+
-+profiler+ is a wrapper around the "ruby-prof":http://ruby-prof.rubyforge.org gem.
-
Usage:
<shell>
-$ rails profiler 'Person.expensive_method(10)' [times] [flat|graph|graph_html]
-</shell>
-
-Examples:
-
-<shell>
-$ rails profiler 'Item.all'
+Usage: rails benchmarker 'Ruby.code' 'Ruby.more_code' ... [OPTS]
+ -r, --runs N Number of runs.
+ Default: 1
+ -o, --output PATH Directory to use when writing the results.
+ Default: tmp/performance
+ --metrics a,b,c Metrics to use.
+ Default: process_time,memory,objects
+ -m, --formats x,y,z Formats to output to.
+ Default: flat,graph_html,call_tree
</shell>
-This will profile +Item.all+ in +RubyProf::WALL_TIME+ measure mode. By default, it prints flat output to the shell.
+Example:
<shell>
-$ rails profiler 'Item.all' 10 graph
+$ rails profiler 'Item.all' 'CouchItem.all' --runs 2 --metrics process_time --formats flat
</shell>
-This will profile +10.times { Item.all }+ with +RubyProf::WALL_TIME+ measure mode and print graph output to the shell.
-
-If you want to store the output in a file:
-
-<shell>
-$ rails profiler 'Item.all' 10 graph 2> graph.txt
-</shell>
+NOTE: Metrics and formats vary from interpreter to interpreter. Pass +--help+ to each tool to see the defaults for your interpreter.
h3. Helper Methods