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

Inherits:
Object
  • Object
show all
Defined in:
activesupport/lib/active_support/testing/performance.rb,
activesupport/lib/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.



148
149
150
# File 'activesupport/lib/active_support/testing/performance.rb', line 148

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

Instance Method Details

#reportObject



152
153
154
155
156
157
158
159
# File 'activesupport/lib/active_support/testing/performance.rb', line 152

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