Class: ActiveSupport::Testing::Performance::Performer

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

Direct Known Subclasses

Benchmarker, Profiler

Instance Method Summary collapse

Constructor Details

#initialize(harness, metric) ⇒ Performer

Returns a new instance of Performer.



124
125
126
# File 'lib/rails/perftest/active_support/testing/performance.rb', line 124

def initialize(harness, metric)
  @harness, @metric, @supported = harness, metric, false
end

Instance Method Details

#reportObject



128
129
130
131
132
133
134
135
# File 'lib/rails/perftest/active_support/testing/performance.rb', line 128

def report
  if @supported
    rate = @total / full_profile_options[:runs]
    '%20s: %s' % [@metric.name, @metric.format(rate)]
  else
    '%20s: unsupported' % @metric.name
  end
end