Changeset 8792
- Timestamp:
- 02/03/08 12:11:12 (10 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/lib/action_controller/request_profiler.rb
r8701 r8792 120 120 opt.on('-n', '--times [100]', 'How many requests to process. Defaults to 100.') { |v| options[:n] = v.to_i if v } 121 121 opt.on('-b', '--benchmark', 'Benchmark instead of profiling') { |v| options[:benchmark] = v } 122 opt.on('-m', '--measure [mode]', 'Which ruby-prof measure mode to use: process_time, wall_time, cpu_time, allocations, or memory. Defaults to process_time.') { |v| options[:measure] = v } 122 123 opt.on('--open [CMD]', 'Command to open profile results. Defaults to "open %s &"') { |v| options[:open] = v } 123 124 opt.on('-h', '--help', 'Show this help') { puts opt; exit } … … 137 138 begin 138 139 require 'ruby-prof' 139 #RubyProf.measure_mode = RubyProf::ALLOCATED_OBJECTS 140 if mode = options[:measure] 141 RubyProf.measure_mode = RubyProf.const_get(mode.upcase) 142 end 140 143 rescue LoadError 141 144 abort '`gem install ruby-prof` to use the profiler'