module BigBench::Configuration

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:

duration*

How long will the benchmark take by default. This value can be overridden by every benchmark.

output*

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.

users

How many users execute the benchmarks concurrently. This can be overridden by every benchmark and defaults to 1.

basic_auth

A basic authentication that is used by ALL requests. This can be overridden per fragment in every benchmark.

BigBench.config.basic_auth = ['username', 'password']

Constants

DEFAULTS

Public Class Methods

config() click to toggle source

Returns tor creates the config object

# File lib/bigbench/configuration.rb, line 46
def self.config
  @@config ||= OpenStruct.new(DEFAULTS)
end
reset!() click to toggle source

Resets the config object

# File lib/bigbench/configuration.rb, line 39
def self.reset!
  @@config = nil
end