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

Inherits:
Object
  • Object
show all
Defined in:
lib/active_support/testing/performance.rb

Direct Known Subclasses

Benchmarker, Profiler

Instance Method Summary collapse

Constructor Details

#initialize(harness, metric) ⇒ Performer

Returns a new instance of Performer.


96
97
98
# File 'lib/active_support/testing/performance.rb', line 96

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

Instance Method Details

#reportObject


100
101
102
103
# File 'lib/active_support/testing/performance.rb', line 100

def report
  rate = @total / profile_options[:runs]
  '%20s: %s' % [@metric.name, @metric.format(rate)]
end