each implementation should define metrics and freeze the defaults
# File lib/active_support/testing/performance.rb, line 36 def full_profile_options DEFAULTS.merge(profile_options) end
# File lib/active_support/testing/performance.rb, line 40 def full_test_name "#{self.class.name}##{method_name}" end
overridden by each implementation
# File lib/active_support/testing/performance.rb, line 124 def run_gc; end
# File lib/active_support/testing/performance.rb, line 136 def run_profile(metric) klass = full_profile_options[:benchmark] ? Benchmarker : Profiler performer = klass.new(self, metric) performer.run puts performer.report performer.record end
# File lib/active_support/testing/performance.rb, line 126 def run_warmup run_gc time = Metrics::Time.new run_test(time, :benchmark) puts "%s (%s warmup)" % [full_test_name, time.format(time.total)] run_gc end