method
parse_options
rails latest stable - Class:
ActionController::RequestProfiler
Method deprecated or moved
This method is deprecated or moved on the latest stable version. The last existing version (v2.2.1) is shown here.
parse_options(args)public
Parse command-line options
# File actionpack/lib/action_controller/request_profiler.rb, line 125
def parse_options(args)
OptionParser.new do |opt|
opt.banner = "USAGE: #{$0} [options] [session script path]"
opt.on('-n', '--times [100]', 'How many requests to process. Defaults to 100.') { |v| options[:n] = v.to_i if v }
opt.on('-b', '--benchmark', 'Benchmark instead of profiling') { |v| options[:benchmark] = v }
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 }
opt.on('--open [CMD]', 'Command to open profile results. Defaults to "open %s &"') { |v| options[:open] = v }
opt.on('-h', '--help', 'Show this help') { puts opt; exit }
opt.parse args
if args.empty?
puts opt
exit
end
options[:script] = args.pop
end
end Related methods
- Instance methods
- benchmark
- default_options
- parse_options
- profile
- run
- warmup
- Class methods
- new
- run
- Protected methods
-
load_ruby_prof -
show_profile_results