class ActiveSupport::Testing::Performance::Profiler
overridden by each implementation.
Public Class Methods
new(*args)
click to toggle source
Calls superclass method
ActiveSupport::Testing::Performance::Performer::new
# File lib/rails/perftest/active_support/testing/performance/jruby.rb, line 22 def initialize(*args) super @supported = @metric.is_a?(Metrics::WallTime) end
Public Instance Methods
record()
click to toggle source
# File lib/rails/perftest/active_support/testing/performance.rb, line 152 def record; end
run()
click to toggle source
# File lib/rails/perftest/active_support/testing/performance.rb, line 151 def run; end
time_with_block() { || ... }
click to toggle source
# File lib/rails/perftest/active_support/testing/performance.rb, line 145 def time_with_block before = Time.now yield Time.now - before end
Protected Instance Methods
create_path_and_open_file(printer_name) { |file| ... }
click to toggle source
# File lib/rails/perftest/active_support/testing/performance/rubinius.rb, line 56 def create_path_and_open_file(printer_name) fname = "#{output_filename}_#{printer_name}.txt" FileUtils.mkdir_p(File.dirname(fname)) File.open(fname, 'wb') do |file| yield(file) end end
output_filename(printer_class)
click to toggle source
# File lib/rails/perftest/active_support/testing/performance/jruby.rb, line 52 def output_filename(printer_class) suffix = case printer_class.name.demodulize when 'FlatProfilePrinter'; 'flat.txt' when 'GraphProfilePrinter'; 'graph.txt' else printer_class.name.sub(/ProfilePrinter$/, '').underscore end "#{super()}_#{suffix}" end