Class: Grntest::BenchmarkResult
- Inherits:
-
BaseResult
- Object
- BaseResult
- Grntest::BenchmarkResult
- Defined in:
- lib/grntest/test-runner.rb
Instance Attribute Summary collapse
-
#n_items ⇒ Object
readonly
Returns the value of attribute n_items.
-
#n_iterations ⇒ Object
readonly
Returns the value of attribute n_iterations.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from BaseResult
#cpu_elapsed_time, #real_elapsed_time
Instance Method Summary collapse
-
#initialize(name, n_items, n_iterations) ⇒ BenchmarkResult
constructor
A new instance of BenchmarkResult.
- #items_per_second ⇒ Object
Methods inherited from BaseResult
Constructor Details
#initialize(name, n_items, n_iterations) ⇒ BenchmarkResult
Returns a new instance of BenchmarkResult.
35 36 37 38 39 40 |
# File 'lib/grntest/test-runner.rb', line 35 def initialize(name, n_items, n_iterations) super() @name = name @n_items = n_items @n_iterations = n_iterations end |
Instance Attribute Details
#n_items ⇒ Object (readonly)
Returns the value of attribute n_items.
33 34 35 |
# File 'lib/grntest/test-runner.rb', line 33 def n_items @n_items end |
#n_iterations ⇒ Object (readonly)
Returns the value of attribute n_iterations.
34 35 36 |
# File 'lib/grntest/test-runner.rb', line 34 def n_iterations @n_iterations end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
32 33 34 |
# File 'lib/grntest/test-runner.rb', line 32 def name @name end |
Instance Method Details
#items_per_second ⇒ Object
42 43 44 |
# File 'lib/grntest/test-runner.rb', line 42 def items_per_second @n_items / @real_elapsed_time end |