Class: Smokey::Runner
- Inherits:
-
Object
- Object
- Smokey::Runner
- Defined in:
- lib/smokey.rb
Instance Attribute Summary collapse
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#delay ⇒ Object
readonly
Returns the value of attribute delay.
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#rampup ⇒ Object
readonly
Returns the value of attribute rampup.
-
#testscript ⇒ Object
readonly
Returns the value of attribute testscript.
-
#think_time ⇒ Object
readonly
Returns the value of attribute think_time.
-
#vusers ⇒ Object
readonly
Returns the value of attribute vusers.
Instance Method Summary collapse
-
#initialize(testscript, vusers, base_url, duration, delay, rampup, think_time) ⇒ Runner
constructor
A new instance of Runner.
- #start_test ⇒ Object
Constructor Details
#initialize(testscript, vusers, base_url, duration, delay, rampup, think_time) ⇒ Runner
Returns a new instance of Runner.
8 9 10 11 12 13 14 15 16 |
# File 'lib/smokey.rb', line 8 def initialize(testscript, vusers, base_url, duration, delay, rampup, think_time) @testscript = testscript @vusers = vusers @base_url = base_url @duration = duration @delay = delay @rampup = rampup @think_time = think_time end |
Instance Attribute Details
#base_url ⇒ Object (readonly)
Returns the value of attribute base_url.
6 7 8 |
# File 'lib/smokey.rb', line 6 def base_url @base_url end |
#delay ⇒ Object (readonly)
Returns the value of attribute delay.
6 7 8 |
# File 'lib/smokey.rb', line 6 def delay @delay end |
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
6 7 8 |
# File 'lib/smokey.rb', line 6 def duration @duration end |
#rampup ⇒ Object (readonly)
Returns the value of attribute rampup.
6 7 8 |
# File 'lib/smokey.rb', line 6 def rampup @rampup end |
#testscript ⇒ Object (readonly)
Returns the value of attribute testscript.
6 7 8 |
# File 'lib/smokey.rb', line 6 def testscript @testscript end |
#think_time ⇒ Object (readonly)
Returns the value of attribute think_time.
6 7 8 |
# File 'lib/smokey.rb', line 6 def think_time @think_time end |
#vusers ⇒ Object (readonly)
Returns the value of attribute vusers.
6 7 8 |
# File 'lib/smokey.rb', line 6 def vusers @vusers end |
Instance Method Details
#start_test ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/smokey.rb', line 18 def start_test threads = [] @vusers.times do thread = Thread.new do VirtualUser.new(@testscript, @base_url).start end threads << thread end threads.each { |t| t.join } end |