The configuration is configured in the test reciepts and looks like this:
BigBench.configure = { :duration => 10.seconds, :output => "test.ljson", :threads => 20 }
Single values can be set and retrieved like this:
BigBench.config.duration = 20.minutes BigBench.config.duration # => 1200 (seconds)
The following configuration values are possible - stared configurations need to be present:
How long will the benchmark take by default. This value can be overridden by every benchmark.
The file where the results should be written to. Usually one takes the
*.ljson
format which is simply a file that contains a fully
valid JSON object on every line. This makes it easy to process the results
later on, because there’s no need to parse the whole results JSON, which
can get huge, at once.
How many threads execute the benchmarks. This can be overridden by every
benchmark and defaults to 1
.
Returns the current config object
# File lib/bigbench/configuration.rb, line 70 def self.config @config end
Configures the benchmarks with a hash. If the config methods are not present yet, they are added to the config object
# File lib/bigbench/configuration.rb, line 61 def self.configure=(config) raise "Config must be a Hash" unless config.is_a?(Hash) config.each { |option, value| @config.class.add_option(option) @config.send "#{option}=", value } end
Resets the config object
# File lib/bigbench/configuration.rb, line 75 def self.reset! @config = Config.new end