Class: Drnbench::PublishSubscribe::Configuration
- Inherits:
-
Object
- Object
- Drnbench::PublishSubscribe::Configuration
- Defined in:
- lib/drnbench/publish-subscribe/configuration.rb
Instance Attribute Summary collapse
-
#engine ⇒ Object
Returns the value of attribute engine.
-
#feed_file ⇒ Object
Returns the value of attribute feed_file.
-
#n_publishings ⇒ Object
Returns the value of attribute n_publishings.
-
#n_steps ⇒ Object
Returns the value of attribute n_steps.
-
#output_path ⇒ Object
Returns the value of attribute output_path.
-
#protocol_adapter ⇒ Object
Returns the value of attribute protocol_adapter.
-
#report_progressively ⇒ Object
Returns the value of attribute report_progressively.
-
#start_n_subscribers ⇒ Object
Returns the value of attribute start_n_subscribers.
-
#subscribe_request_file ⇒ Object
Returns the value of attribute subscribe_request_file.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Instance Method Summary collapse
- #feed ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #new_feed ⇒ Object
- #new_subscribe_request ⇒ Object
- #subscribe_request ⇒ Object
- #validate ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/drnbench/publish-subscribe/configuration.rb', line 25 def initialize @start_n_subscribers = 1000 @n_publishings = 1000 @n_steps = 10 @timeout = 10 @report_progressively = true @output_path = "/tmp/drnbench-pubsub-result.csv" @engine = Server::EngineConfiguration.new @protocol_adapter = Server::ProtocolAdapterConfiguration.new @protocol_adapter.engine = @engine end |
Instance Attribute Details
#engine ⇒ Object
Returns the value of attribute engine.
22 23 24 |
# File 'lib/drnbench/publish-subscribe/configuration.rb', line 22 def engine @engine end |
#feed_file ⇒ Object
Returns the value of attribute feed_file.
22 23 24 |
# File 'lib/drnbench/publish-subscribe/configuration.rb', line 22 def feed_file @feed_file end |
#n_publishings ⇒ Object
Returns the value of attribute n_publishings.
21 22 23 |
# File 'lib/drnbench/publish-subscribe/configuration.rb', line 21 def n_publishings @n_publishings end |
#n_steps ⇒ Object
Returns the value of attribute n_steps.
21 22 23 |
# File 'lib/drnbench/publish-subscribe/configuration.rb', line 21 def n_steps @n_steps end |
#output_path ⇒ Object
Returns the value of attribute output_path.
23 24 25 |
# File 'lib/drnbench/publish-subscribe/configuration.rb', line 23 def output_path @output_path end |
#protocol_adapter ⇒ Object
Returns the value of attribute protocol_adapter.
22 23 24 |
# File 'lib/drnbench/publish-subscribe/configuration.rb', line 22 def protocol_adapter @protocol_adapter end |
#report_progressively ⇒ Object
Returns the value of attribute report_progressively.
23 24 25 |
# File 'lib/drnbench/publish-subscribe/configuration.rb', line 23 def report_progressively @report_progressively end |
#start_n_subscribers ⇒ Object
Returns the value of attribute start_n_subscribers.
21 22 23 |
# File 'lib/drnbench/publish-subscribe/configuration.rb', line 21 def start_n_subscribers @start_n_subscribers end |
#subscribe_request_file ⇒ Object
Returns the value of attribute subscribe_request_file.
22 23 24 |
# File 'lib/drnbench/publish-subscribe/configuration.rb', line 22 def subscribe_request_file @subscribe_request_file end |
#timeout ⇒ Object
Returns the value of attribute timeout.
21 22 23 |
# File 'lib/drnbench/publish-subscribe/configuration.rb', line 21 def timeout @timeout end |
Instance Method Details
#feed ⇒ Object
56 57 58 |
# File 'lib/drnbench/publish-subscribe/configuration.rb', line 56 def feed @feed ||= prepare_feed end |
#new_feed ⇒ Object
60 61 62 |
# File 'lib/drnbench/publish-subscribe/configuration.rb', line 60 def new_feed Marshal.load(Marshal.dump(feed)) end |
#new_subscribe_request ⇒ Object
52 53 54 |
# File 'lib/drnbench/publish-subscribe/configuration.rb', line 52 def new_subscribe_request Marshal.load(Marshal.dump(subscribe_request)) end |
#subscribe_request ⇒ Object
48 49 50 |
# File 'lib/drnbench/publish-subscribe/configuration.rb', line 48 def subscribe_request @subscribe_request ||= prepare_subscribe_request end |
#validate ⇒ Object
39 40 41 42 43 44 45 46 |
# File 'lib/drnbench/publish-subscribe/configuration.rb', line 39 def validate if @subscribe_request_file.nil? raise ArgumentError.new("You must specify a JSON file for a message pattern to subscribe.") end if @feed_file.nil? raise ArgumentError.new("You must specify a JSON file for a message pattern to feed.") end end |