Class: Yardstick::MeasurementSet
- Inherits:
-
OrderedSet
- Object
- OrderedSet
- Yardstick::MeasurementSet
- Defined in:
- lib/yardstick/measurement_set.rb
Overview
A set of yardstick measurements
Instance Method Summary collapse
-
#coverage ⇒ Integer, Rational
The percentage of successful measurements.
-
#failed ⇒ Integer
The number of failed measurements.
-
#puts(io = $stdout) ⇒ undefined
Warn the unsuccessful measurements and a summary.
-
#successful ⇒ Integer
The number of successful measurements.
-
#total ⇒ Integer
The total number of measurements.
Methods inherited from OrderedSet
#<<, #each, #empty?, #include?, #index, #initialize, #length, #merge
Constructor Details
This class inherits a constructor from Yardstick::OrderedSet
Instance Method Details
#coverage ⇒ Integer, Rational
The percentage of successful measurements
57 58 59 |
# File 'lib/yardstick/measurement_set.rb', line 57 def coverage empty? ? 1 : Rational(successful, total) end |
#failed ⇒ Integer
The number of failed measurements
43 44 45 |
# File 'lib/yardstick/measurement_set.rb', line 43 def failed total - successful end |
#puts(io = $stdout) ⇒ undefined
Warn the unsuccessful measurements and a summary
72 73 74 75 |
# File 'lib/yardstick/measurement_set.rb', line 72 def puts(io = $stdout) each { |measurement| measurement.puts(io) } puts_summary(io) end |
#successful ⇒ Integer
The number of successful measurements
30 31 32 |
# File 'lib/yardstick/measurement_set.rb', line 30 def successful select { |measurement| measurement.ok? }.length end |
#total ⇒ Integer
The total number of measurements
17 18 19 |
# File 'lib/yardstick/measurement_set.rb', line 17 def total length end |