Class: Zombees::AbAdapter::Command
- Inherits:
-
Object
- Object
- Zombees::AbAdapter::Command
- Defined in:
- lib/zombees/ab_adapter.rb
Instance Attribute Summary collapse
-
#ab_options ⇒ Object
readonly
Returns the value of attribute ab_options.
-
#concurrency ⇒ Object
readonly
Returns the value of attribute concurrency.
-
#requests ⇒ Object
readonly
Returns the value of attribute requests.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #command ⇒ Object
- #default ⇒ Object
-
#initialize(options = {}) ⇒ Command
constructor
A new instance of Command.
- #run(worker) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Command
Returns a new instance of Command.
42 43 44 45 46 47 48 |
# File 'lib/zombees/ab_adapter.rb', line 42 def initialize(={}) = default.merge() @requests = [:requests] @concurrency = [:concurrency] @url = [:url] = [:ab_options] end |
Instance Attribute Details
#ab_options ⇒ Object (readonly)
Returns the value of attribute ab_options.
40 41 42 |
# File 'lib/zombees/ab_adapter.rb', line 40 def end |
#concurrency ⇒ Object (readonly)
Returns the value of attribute concurrency.
40 41 42 |
# File 'lib/zombees/ab_adapter.rb', line 40 def concurrency @concurrency end |
#requests ⇒ Object (readonly)
Returns the value of attribute requests.
40 41 42 |
# File 'lib/zombees/ab_adapter.rb', line 40 def requests @requests end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
40 41 42 |
# File 'lib/zombees/ab_adapter.rb', line 40 def url @url end |
Instance Method Details
#command ⇒ Object
58 59 60 61 |
# File 'lib/zombees/ab_adapter.rb', line 58 def command "ab -r -n #{requests} -c #{concurrency} " + %Q{-C "sessionid=fake" #{ab_options} "#{url}"} end |
#default ⇒ Object
50 51 52 |
# File 'lib/zombees/ab_adapter.rb', line 50 def default {} end |
#run(worker) ⇒ Object
54 55 56 |
# File 'lib/zombees/ab_adapter.rb', line 54 def run(worker) worker.run_command(command) end |