Module: Benchmark::IPS::Stats::StatsMetric

Included in:
Bootstrap, SD
Defined in:
lib/benchmark/ips/stats/stats_metric.rb

Instance Method Summary collapse

Instance Method Details

#error_percentageFloat

Return entry’s standard deviation of iteration per second in percentage.

Returns:

  • (Float)

    @ips_sd in percentage.



7
8
9
# File 'lib/benchmark/ips/stats/stats_metric.rb', line 7

def error_percentage
  100.0 * (error.to_f / central_tendency)
end

#overlaps?(baseline) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
14
15
16
17
# File 'lib/benchmark/ips/stats/stats_metric.rb', line 11

def overlaps?(baseline)
  baseline_low = baseline.central_tendency - baseline.error
  baseline_high = baseline.central_tendency + baseline.error
  my_high = central_tendency + error
  my_low  = central_tendency - error
  my_high > baseline_low && my_low < baseline_high
end