Class: Drnbench::RequestResponse::Configuration
- Inherits:
-
Object
- Object
- Drnbench::RequestResponse::Configuration
- Defined in:
- lib/drnbench/request-response/configuration.rb
Constant Summary collapse
- MIN_DURATION =
1
- MIN_WAIT =
0
Instance Attribute Summary collapse
-
#default_host ⇒ Object
Returns the value of attribute default_host.
-
#default_method ⇒ Object
Returns the value of attribute default_method.
-
#default_path ⇒ Object
Returns the value of attribute default_path.
-
#default_port ⇒ Object
Returns the value of attribute default_port.
-
#default_timeout ⇒ Object
Returns the value of attribute default_timeout.
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#end_n_clients ⇒ Object
Returns the value of attribute end_n_clients.
-
#interval ⇒ Object
Returns the value of attribute interval.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#n_requests ⇒ Object
Returns the value of attribute n_requests.
-
#n_slow_requests ⇒ Object
Returns the value of attribute n_slow_requests.
-
#output_path ⇒ Object
Returns the value of attribute output_path.
-
#report_progressively ⇒ Object
Returns the value of attribute report_progressively.
-
#request_patterns_file ⇒ Object
Returns the value of attribute request_patterns_file.
-
#start_n_clients ⇒ Object
Returns the value of attribute start_n_clients.
-
#step ⇒ Object
Returns the value of attribute step.
-
#wait ⇒ Object
Returns the value of attribute wait.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #request_patterns ⇒ Object
- #validate ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/drnbench/request-response/configuration.rb', line 30 def initialize @wait = 1 @interval = 5 @start_n_clients = 1 @end_n_clients = 1 @step = 1 @n_requests = 1000 @mode = :http @n_slow_requests = 5 @default_host = "localhost" @default_port = 80 @default_path = "/" @default_method = "GET" @default_timeout = 5.0 @report_progressively = true @output_path = "/tmp/drnbench-result.csv" end |
Instance Attribute Details
#default_host ⇒ Object
Returns the value of attribute default_host.
24 25 26 |
# File 'lib/drnbench/request-response/configuration.rb', line 24 def default_host @default_host end |
#default_method ⇒ Object
Returns the value of attribute default_method.
24 25 26 |
# File 'lib/drnbench/request-response/configuration.rb', line 24 def default_method @default_method end |
#default_path ⇒ Object
Returns the value of attribute default_path.
24 25 26 |
# File 'lib/drnbench/request-response/configuration.rb', line 24 def default_path @default_path end |
#default_port ⇒ Object
Returns the value of attribute default_port.
24 25 26 |
# File 'lib/drnbench/request-response/configuration.rb', line 24 def default_port @default_port end |
#default_timeout ⇒ Object
Returns the value of attribute default_timeout.
24 25 26 |
# File 'lib/drnbench/request-response/configuration.rb', line 24 def default_timeout @default_timeout end |
#duration ⇒ Object
Returns the value of attribute duration.
21 22 23 |
# File 'lib/drnbench/request-response/configuration.rb', line 21 def duration @duration end |
#end_n_clients ⇒ Object
Returns the value of attribute end_n_clients.
22 23 24 |
# File 'lib/drnbench/request-response/configuration.rb', line 22 def end_n_clients @end_n_clients end |
#interval ⇒ Object
Returns the value of attribute interval.
21 22 23 |
# File 'lib/drnbench/request-response/configuration.rb', line 21 def interval @interval end |
#mode ⇒ Object
Returns the value of attribute mode.
23 24 25 |
# File 'lib/drnbench/request-response/configuration.rb', line 23 def mode @mode end |
#n_requests ⇒ Object
Returns the value of attribute n_requests.
22 23 24 |
# File 'lib/drnbench/request-response/configuration.rb', line 22 def n_requests @n_requests end |
#n_slow_requests ⇒ Object
Returns the value of attribute n_slow_requests.
22 23 24 |
# File 'lib/drnbench/request-response/configuration.rb', line 22 def n_slow_requests @n_slow_requests end |
#output_path ⇒ Object
Returns the value of attribute output_path.
25 26 27 |
# File 'lib/drnbench/request-response/configuration.rb', line 25 def output_path @output_path end |
#report_progressively ⇒ Object
Returns the value of attribute report_progressively.
25 26 27 |
# File 'lib/drnbench/request-response/configuration.rb', line 25 def report_progressively @report_progressively end |
#request_patterns_file ⇒ Object
Returns the value of attribute request_patterns_file.
21 22 23 |
# File 'lib/drnbench/request-response/configuration.rb', line 21 def request_patterns_file @request_patterns_file end |
#start_n_clients ⇒ Object
Returns the value of attribute start_n_clients.
22 23 24 |
# File 'lib/drnbench/request-response/configuration.rb', line 22 def start_n_clients @start_n_clients end |
#step ⇒ Object
Returns the value of attribute step.
22 23 24 |
# File 'lib/drnbench/request-response/configuration.rb', line 22 def step @step end |
#wait ⇒ Object
Returns the value of attribute wait.
21 22 23 |
# File 'lib/drnbench/request-response/configuration.rb', line 21 def wait @wait end |
Instance Method Details
#request_patterns ⇒ Object
71 72 73 |
# File 'lib/drnbench/request-response/configuration.rb', line 71 def request_patterns @request_patterns ||= prepare_request_patterns end |
#validate ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'lib/drnbench/request-response/configuration.rb', line 50 def validate if @duration.nil? raise ArgumentError.new("You must specify the test duration.") end if @request_patterns_file.nil? raise ArgumentError.new("You must specify the path to the request patterns JSON file.") end end |