Namespace
- MODULE ActiveSupport::Testing::Performance::ForClassicTestUnit
- MODULE ActiveSupport::Testing::Performance::ForMiniTest
- MODULE ActiveSupport::Testing::Performance::Metrics
- CLASS ActiveSupport::Testing::Performance::Benchmarker
- CLASS ActiveSupport::Testing::Performance::Performer
- CLASS ActiveSupport::Testing::Performance::Profiler
Methods
Included Modules
- ActiveSupport::Testing::Performance::ForMiniTest
- ActiveSupport::Testing::Performance::ForClassicTestUnit
Constants
DEFAULTS | = | if ARGV.include?('--benchmark') # HAX for rake test { :runs => 4, :output => 'tmp/performance', :benchmark => true } else { :runs => 1, :output => 'tmp/performance', :benchmark => false } end |
each implementation should define metrics and freeze the defaults |
Instance Public methods
Source: show
# File activesupport/lib/active_support/testing/performance.rb, line 36 def full_profile_options DEFAULTS.merge(profile_options) end
Source: show
# File activesupport/lib/active_support/testing/performance.rb, line 40 def full_test_name "#{self.class.name}##{method_name}" end
Instance Protected methods
overridden by each implementation
Source: show
# File activesupport/lib/active_support/testing/performance.rb, line 124 def run_gc; end
Source: show
# File activesupport/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
Source: show
# File activesupport/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