Class: RSpec::Benchmark::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/benchmark/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Configuration.



39
40
41
42
43
44
45
# File 'lib/rspec/benchmark/configuration.rb', line 39

def initialize
  @disable_gc  = false
  @samples     = 1
  @fit_quality = 0.9
  @format      = :human
  @run_in_subprocess = false
end

Instance Attribute Details

#disable_gcObject

GC is enabled to measure real performance



15
16
17
# File 'lib/rspec/benchmark/configuration.rb', line 15

def disable_gc
  @disable_gc
end

#fit_qualityFloat

The fit quality in computational complexity

Returns:

  • (Float)


29
30
31
# File 'lib/rspec/benchmark/configuration.rb', line 29

def fit_quality
  @fit_quality
end

#formatString

The formatting for number of iterations

Returns:

  • (String)


36
37
38
# File 'lib/rspec/benchmark/configuration.rb', line 36

def format
  @format
end

#run_in_subprocessObject

Isolate benchmark time measurement in child process By default false due to Rails loosing DB connections



10
11
12
# File 'lib/rspec/benchmark/configuration.rb', line 10

def run_in_subprocess
  @run_in_subprocess
end

#samplesInteger

How many times to repeat measurements

Returns:

  • (Integer)


22
23
24
# File 'lib/rspec/benchmark/configuration.rb', line 22

def samples
  @samples
end