The configuration is configured in the test reciepts and looks like this:
BigBench.configure do |config| config.duration = 10.seconds, config.output = "test.ljson", config.users = 20, config.basic_auth = ['username', 'secret'] end
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 users execute the benchmarks concurrently. This can be overridden
by every benchmark and defaults to 1
.
A basic authentication that is used by ALL requests. This can be overridden per fragment in every benchmark.
BigBench.config.basic_auth = ['username', 'password']
Returns tor creates the config object
# File lib/bigbench/configuration.rb, line 46 def self.config @@config ||= OpenStruct.new(DEFAULTS) end
Resets the config object
# File lib/bigbench/configuration.rb, line 39 def self.reset! @@config = nil end