# File lib/active_support/testing/performance.rb, line 235 def initialize @total = 0 end
# File lib/active_support/testing/performance.rb, line 251 def benchmark with_gc_stats do before = measure yield @total += (measure - before) end end
# File lib/active_support/testing/performance.rb, line 247 def measure 0 end
# File lib/active_support/testing/performance.rb, line 243 def measure_mode self.class::Mode end
# File lib/active_support/testing/performance.rb, line 239 def name @name ||= self.class.name.demodulize.underscore end
# File lib/active_support/testing/performance.rb, line 259 def profile RubyProf.resume yield ensure RubyProf.pause end
# File lib/active_support/testing/performance.rb, line 269 def with_gc_stats GC::Profiler.enable GC.start yield ensure GC::Profiler.disable end