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

Attributes

total[R]

Public Instance Methods

benchmark() { || ... } click to toggle source
# File lib/active_support/testing/performance.rb, line 251
def benchmark
  with_gc_stats do
    before = measure
    yield
    @total += (measure - before)
  end
end
measure() click to toggle source
# File lib/active_support/testing/performance.rb, line 247
def measure
  0
end
measure_mode() click to toggle source
# File lib/active_support/testing/performance.rb, line 243
def measure_mode
  self.class::Mode
end
name() click to toggle source
# File lib/active_support/testing/performance.rb, line 239
def name
  @name ||= self.class.name.demodulize.underscore
end
profile() { || ... } click to toggle source
# File lib/active_support/testing/performance.rb, line 259
def profile
  RubyProf.resume
  yield
ensure
  RubyProf.pause
end

Protected Instance Methods

with_gc_stats() { || ... } click to toggle source
# File lib/active_support/testing/performance.rb, line 269
def with_gc_stats
  GC::Profiler.enable
  GC.start
  yield
ensure
  GC::Profiler.disable
end

Public Class Methods

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