Parent

Class Index [+]

Quicksearch

ActiveSupport::Testing::Performance::Metrics::Base

Attributes

total[R]

Public Class Methods

new() click to toggle source
     # File lib/active_support/testing/performance.rb, line 235
235:             def initialize
236:               @total = 0
237:             end

Public Instance Methods

benchmark() click to toggle source
     # File lib/active_support/testing/performance.rb, line 251
251:             def benchmark
252:               with_gc_stats do
253:                 before = measure
254:                 yield
255:                 @total += (measure - before)
256:               end
257:             end
measure() click to toggle source
     # File lib/active_support/testing/performance.rb, line 247
247:             def measure
248:               0
249:             end
measure_mode() click to toggle source
     # File lib/active_support/testing/performance.rb, line 243
243:             def measure_mode
244:               self.class::Mode
245:             end
name() click to toggle source
     # File lib/active_support/testing/performance.rb, line 239
239:             def name
240:               @name ||= self.class.name.demodulize.underscore
241:             end
profile() click to toggle source
     # File lib/active_support/testing/performance.rb, line 259
259:             def profile
260:               RubyProf.resume
261:               yield
262:             ensure
263:               RubyProf.pause
264:             end

Protected Instance Methods

with_gc_stats() click to toggle source
     # File lib/active_support/testing/performance.rb, line 269
269:                 def with_gc_stats
270:                   GC::Profiler.enable
271:                   GC.start
272:                   yield
273:                 ensure
274:                   GC::Profiler.disable
275:                 end
with_gc_stats() click to toggle source
     # File lib/active_support/testing/performance.rb, line 279
279:                 def with_gc_stats
280:                   GC.enable_stats
281:                   yield
282:                 ensure
283:                   GC.disable_stats
284:                 end
with_gc_stats() click to toggle source
     # File lib/active_support/testing/performance.rb, line 287
287:                 def with_gc_stats
288:                   yield
289:                 end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.