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
55 56 57 |
# File 'lib/yardstick/measurement_set.rb', line 55 def coverage empty? ? 1 : Rational(successful, total) end |
#failed ⇒ Integer
The number of failed measurements
41 42 43 |
# File 'lib/yardstick/measurement_set.rb', line 41 def failed total - successful end |
#puts(io = $stdout) ⇒ undefined
Warn the unsuccessful measurements and a summary
70 71 72 73 |
# File 'lib/yardstick/measurement_set.rb', line 70 def puts(io = $stdout) each { |measurement| measurement.puts(io) } puts_summary(io) end |
#successful ⇒ Integer
The number of successful measurements
28 29 30 |
# File 'lib/yardstick/measurement_set.rb', line 28 def successful select { |measurement| measurement.ok? }.length end |
#total ⇒ Integer
The total number of measurements
15 16 17 |
# File 'lib/yardstick/measurement_set.rb', line 15 def total length end |