Class: ActiveSupport::Testing::Performance::Profiler

Inherits:
Performer
  • Object
show all
Defined in:
lib/rails/perftest/active_support/testing/performance.rb,
lib/rails/perftest/active_support/testing/performance/ruby.rb,
lib/rails/perftest/active_support/testing/performance/jruby.rb,
lib/rails/perftest/active_support/testing/performance/rubinius.rb

Overview

overridden by each implementation.

Instance Method Summary collapse

Methods inherited from Performer

#report

Constructor Details

#initialize(*args) ⇒ Profiler

Returns a new instance of Profiler.



27
28
29
30
# File 'lib/rails/perftest/active_support/testing/performance/ruby.rb', line 27

def initialize(*args)
  super
  @supported = @metric.measure_mode rescue false
end

Instance Method Details

#recordObject



152
# File 'lib/rails/perftest/active_support/testing/performance.rb', line 152

def record; end

#runObject



151
# File 'lib/rails/perftest/active_support/testing/performance.rb', line 151

def run;    end

#time_with_blockObject



145
146
147
148
149
# File 'lib/rails/perftest/active_support/testing/performance.rb', line 145

def time_with_block
  before = Time.now
  yield
  Time.now - before
end