Top Level Namespace
Defined Under Namespace
Modules: ActionController, ActionDispatch, ActiveSupport, Rails Classes: BenchmarkerTest, BrowsingTest, ProfilerTest
Instance Method Summary collapse
Instance Method Details
#options ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/rails/perftest/commands/profiler.rb', line 6 def = {} defaults = ActiveSupport::Testing::Performance::DEFAULTS OptionParser.new do |opt| opt. = "Usage: rails profiler 'Ruby.code' 'Ruby.more_code' ... [OPTS]" opt.on('-r', '--runs N', Numeric, 'Number of runs.', "Default: #{defaults[:runs]}") { |r| [:runs] = r } opt.on('-o', '--output PATH', String, 'Directory to use when writing the results.', "Default: #{defaults[:output]}") { |o| [:output] = o } opt.on('-m', '--metrics a,b,c', Array, 'Metrics to use.', "Default: #{defaults[:metrics].join(",")}") { |m| [:metrics] = m.map(&:to_sym) } opt.on('-f', '--formats x,y,z', Array, 'Formats to output to.', "Default: #{defaults[:formats].join(",")}") { |m| [:formats] = m.map(&:to_sym) } opt.parse!(ARGV) end end |