Class: ActiveSupport::Testing::Performance::Performer
- Defined in:
- lib/gems/activesupport-2.2.2/lib/active_support/testing/performance.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(harness, metric) ⇒ Performer
constructor
A new instance of Performer.
- #report ⇒ Object
Constructor Details
#initialize(harness, metric) ⇒ Performer
Returns a new instance of Performer.
96 97 98 |
# File 'lib/gems/activesupport-2.2.2/lib/active_support/testing/performance.rb', line 96 def initialize(harness, metric) @harness, @metric = harness, metric end |
Instance Method Details
#report ⇒ Object
100 101 102 103 |
# File 'lib/gems/activesupport-2.2.2/lib/active_support/testing/performance.rb', line 100 def report rate = @total / [:runs] '%20s: %s' % [@metric.name, @metric.format(rate)] end |