Class: ActiveSupport::Testing::Performance::Performer
- Defined in:
- lib/active_support/testing/performance.rb,
lib/active_support/testing/performance/rubinius.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.
148 149 150 |
# File 'lib/active_support/testing/performance.rb', line 148 def initialize(harness, metric) @harness, @metric, @supported = harness, metric, false end |
Instance Method Details
#report ⇒ Object
152 153 154 155 156 157 158 159 |
# File 'lib/active_support/testing/performance.rb', line 152 def report if @supported rate = @total / [:runs] '%20s: %s' % [@metric.name, @metric.format(rate)] else '%20s: unsupported' % @metric.name end end |