Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Updated README to include info on 'methods' mode

  • Loading branch information...
commit afe7b3cf5b46a0d41fad125206b70582351987cc 1 parent 92f750a
Ben Brinckerhoff bhb authored

Showing 1 changed file with 5 additions and 4 deletions. Show diff stats Hide diff stats

  1. +5 4 README.rdoc
9 README.rdoc
Source Rendered
@@ -55,7 +55,7 @@ For Rack::Builder, call 'use' inside the Builder constructor block
55 55 == Options
56 56
57 57 * :default_printer - can be set to 'text', 'gif', or 'pdf'. Default is :text
58   -* :mode - can be set to 'cputime', 'objects', 'walltime'. Default is :cputime. See the 'Profiling Modes' section below.
  58 +* :mode - can be set to 'cputime', 'methods', 'objects', 'walltime'. Default is :cputime. See the 'Profiling Modes' section below.
59 59 * :frequency - in :cputime mode, the number of times per second the app will be sampled. Default is 100 (times/sec)
60 60 * :bundler - run the profiler binary using 'bundle' if set to true. Default is false
61 61 * :gemfile_dir - directory with Gemfile. Default is the current directory.
@@ -103,8 +103,9 @@ for more details)
103 103 perftools.rb (and therefore, the Rack middleware) can be put into three different profiling modes.
104 104
105 105 * 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'
106   -* Wall time mode - Reports the amount of time (as in, wall clock time) spent in each section of code. Enable by setting ':mode => :walltime'
  106 +* Method call mode - Report how many method calls are made inside each method. Enable by setting ':mode => :methods'
107 107 * Object allocation mode - Reports the percentage of object allocations performed in each section of code. Enable by setting ':mode => :objects'
  108 +* Wall time mode - Reports the amount of time (as in, wall clock time) spent in each section of code. Enable by setting ':mode => :walltime'
108 109
109 110 For example, consider the following Sinatra application:
110 111
@@ -126,9 +127,9 @@ If you change the mode to ':walltime', you'll get profiling data, since the call
126 127
127 128 == Overriding the Profiling mode
128 129
129   -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.
  130 +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.
130 131
131   -To switch to 'object' mode, provide the 'mode' option. When profiling with a single request, add the option to the URL profiled:
  132 +To switch to another mode, provide the 'mode' option. When profiling with a single request, add the option to the URL profiled:
132 133
133 134 curl http://localhost:3000/foobar?profile=true&mode=objects
134 135

0 comments on commit afe7b3c

Please sign in to comment.
Something went wrong with that request. Please try again.