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

Instance Method Summary (collapse)

Constructor Details

- (Performer) initialize(harness, metric)

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

- (Object) report



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