Class: Benchmark::IPS::Stats::SD
- Inherits:
-
Object
- Object
- Benchmark::IPS::Stats::SD
- Includes:
- StatsMetric
- Defined in:
- lib/benchmark/ips/stats/sd.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#samples ⇒ Object
readonly
Returns the value of attribute samples.
Instance Method Summary collapse
-
#central_tendency ⇒ Float
Average stat value.
- #footer ⇒ Object
-
#initialize(samples) ⇒ SD
constructor
A new instance of SD.
-
#slowdown(baseline) ⇒ Object
Determines how much slower this stat is than the baseline stat if this average is lower than the faster baseline, higher average is better (e.g. ips) (calculate accordingly).
- #speedup(baseline) ⇒ Object
Methods included from StatsMetric
Constructor Details
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
7 8 9 |
# File 'lib/benchmark/ips/stats/sd.rb', line 7 def error @error end |
#samples ⇒ Object (readonly)
Returns the value of attribute samples.
7 8 9 |
# File 'lib/benchmark/ips/stats/sd.rb', line 7 def samples @samples end |
Instance Method Details
#central_tendency ⇒ Float
Average stat value
17 18 19 |
# File 'lib/benchmark/ips/stats/sd.rb', line 17 def central_tendency @mean end |
#footer ⇒ Object
37 38 39 |
# File 'lib/benchmark/ips/stats/sd.rb', line 37 def nil end |
#slowdown(baseline) ⇒ Object
Determines how much slower this stat is than the baseline stat if this average is lower than the faster baseline, higher average is better (e.g. ips) (calculate accordingly)
25 26 27 28 29 30 31 |
# File 'lib/benchmark/ips/stats/sd.rb', line 25 def slowdown(baseline) if baseline.central_tendency > central_tendency [baseline.central_tendency.to_f / central_tendency, nil] else [central_tendency.to_f / baseline.central_tendency, nil] end end |
#speedup(baseline) ⇒ Object
33 34 35 |
# File 'lib/benchmark/ips/stats/sd.rb', line 33 def speedup(baseline) baseline.slowdown(self) end |