Permalink
Browse files

Updated README to include info on 'methods' mode

  • Loading branch information...
bhb committed Jan 17, 2011
1 parent 92f750a commit afe7b3cf5b46a0d41fad125206b70582351987cc
Showing with 5 additions and 4 deletions.
  1. +5 −4 README.rdoc
View
@@ -55,7 +55,7 @@ For Rack::Builder, call 'use' inside the Builder constructor block
== Options
* :default_printer - can be set to 'text', 'gif', or 'pdf'. Default is :text
-* :mode - can be set to 'cputime', 'objects', 'walltime'. Default is :cputime. See the 'Profiling Modes' section below.
+* :mode - can be set to 'cputime', 'methods', 'objects', 'walltime'. Default is :cputime. See the 'Profiling Modes' section below.
* :frequency - in :cputime mode, the number of times per second the app will be sampled. Default is 100 (times/sec)
* :bundler - run the profiler binary using 'bundle' if set to true. Default is false
* :gemfile_dir - directory with Gemfile. Default is the current directory.
@@ -103,8 +103,9 @@ for more details)
perftools.rb (and therefore, the Rack middleware) can be put into three different profiling modes.
* CPU time mode - Reports how many CPU cycles are spent in each section of code. This is the default and can be enabled by setting ':mode => :cputime'
-* Wall time mode - Reports the amount of time (as in, wall clock time) spent in each section of code. Enable by setting ':mode => :walltime'
+* Method call mode - Report how many method calls are made inside each method. Enable by setting ':mode => :methods'
* Object allocation mode - Reports the percentage of object allocations performed in each section of code. Enable by setting ':mode => :objects'
+* Wall time mode - Reports the amount of time (as in, wall clock time) spent in each section of code. Enable by setting ':mode => :walltime'
For example, consider the following Sinatra application:
@@ -126,9 +127,9 @@ If you change the mode to ':walltime', you'll get profiling data, since the call
== Overriding the Profiling mode
-You can also switch the profiling mode on a per-request basis, but ONLY if you are switching to 'object' mode. Due to the implementation of perftools.rb, it is NOT possible to switch to 'walltime' or 'cputime' modes.
+You can also switch the profiling mode on a per-request basis, but ONLY if you are switching to 'methods' or 'objects' mode. Due to the implementation of perftools.rb, it is NOT possible to switch to 'walltime' or 'cputime' modes.
-To switch to 'object' mode, provide the 'mode' option. When profiling with a single request, add the option to the URL profiled:
+To switch to another mode, provide the 'mode' option. When profiling with a single request, add the option to the URL profiled:
curl http://localhost:3000/foobar?profile=true&mode=objects

0 comments on commit afe7b3c

Please sign in to comment.