Class: ActiveSupport::Testing::Performance::Performer
- Inherits:
-
Object
- Object
- ActiveSupport::Testing::Performance::Performer
- Defined in:
- lib/rails/perftest/active_support/testing/performance.rb,
lib/rails/perftest/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.
124 125 126 |
# File 'lib/rails/perftest/active_support/testing/performance.rb', line 124 def initialize(harness, metric) @harness, @metric, @supported = harness, metric, false end |
Instance Method Details
#report ⇒ Object
128 129 130 131 132 133 134 135 |
# File 'lib/rails/perftest/active_support/testing/performance.rb', line 128 def report if @supported rate = @total / [:runs] '%20s: %s' % [@metric.name, @metric.format(rate)] else '%20s: unsupported' % @metric.name end end |