Class: RubyJmeter::Plugins::SteppingThreadGroup

Inherits:
Object
  • Object
show all
Includes:
Helper
Defined in:
lib/ruby-jmeter/plugins/stepping_thread_group.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helper

#enabled, #enabled_disabled, #update, #update_at_xpath, #update_collection

Constructor Details

#initialize(params = {}) ⇒ SteppingThreadGroup

Returns a new instance of SteppingThreadGroup.


6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/ruby-jmeter/plugins/stepping_thread_group.rb', line 6

def initialize(params={})
  testname = params.kind_of?(Array) ? 'SteppingThreadGroup' : (params[:name] || 'SteppingThreadGroup')
  @doc = Nokogiri::XML("<kg.apc.jmeter.threads.SteppingThreadGroup guiclass=\"kg.apc.jmeter.threads.SteppingThreadGroupGui\" testclass=\"kg.apc.jmeter.threads.SteppingThreadGroup\" testname=\"\#{testname}\" enabled=\"true\">\n<stringProp name=\"ThreadGroup.on_sample_error\">continue</stringProp>\n<stringProp name=\"ThreadGroup.num_threads\">\#{params[:total_threads]}</stringProp>\n<stringProp name=\"Threads initial delay\">\#{params[:initial_delay]}</stringProp>\n<stringProp name=\"Start users count\">\#{params[:start_threads]}</stringProp>\n<stringProp name=\"Start users count burst\">\#{params[:add_threads]}</stringProp>\n<stringProp name=\"Start users period\">\#{params[:start_every]}</stringProp>\n<stringProp name=\"Stop users count\">\#{params[:stop_threads]}</stringProp>\n<stringProp name=\"Stop users period\">\#{params[:stop_every]}</stringProp>\n<stringProp name=\"flighttime\">\#{params[:flight_time]}</stringProp>\n<stringProp name=\"rampUp\">\#{params[:rampup]}</stringProp>\n<elementProp name=\"ThreadGroup.main_controller\" elementType=\"LoopController\" guiclass=\"LoopControlPanel\" testclass=\"LoopController\" testname=\"Loop Controller\" enabled=\"true\">\n<boolProp name=\"LoopController.continue_forever\">false</boolProp>\n<intProp name=\"LoopController.loops\">-1</intProp>\n</elementProp>\n</kg.apc.jmeter.threads.SteppingThreadGroup>\n".strip_heredoc)
  update params
end

Instance Attribute Details

#docObject

Returns the value of attribute doc


4
5
6
# File 'lib/ruby-jmeter/plugins/stepping_thread_group.rb', line 4

def doc
  @doc
end