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={})
  params[:name] ||= 'jp@gc - Stepping Thread Group'
  @doc = Nokogiri::XML(<<-EOF.strip_heredoc)
    <kg.apc.jmeter.threads.SteppingThreadGroup guiclass="kg.apc.jmeter.threads.SteppingThreadGroupGui" testclass="kg.apc.jmeter.threads.SteppingThreadGroup" testname="#{params[:name]}" enabled="true">
      <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
      <stringProp name="ThreadGroup.num_threads">#{params[:total_threads]}</stringProp>
      <stringProp name="Threads initial delay">#{params[:initial_delay]}</stringProp>
      <stringProp name="Start users count">#{params[:start_threads]}</stringProp>
      <stringProp name="Start users count burst">#{params[:add_threads]}</stringProp>
      <stringProp name="Start users period">#{params[:start_every]}</stringProp>
      <stringProp name="Stop users count">#{params[:stop_threads]}</stringProp>
      <stringProp name="Stop users period">#{params[:stop_every]}</stringProp>
      <stringProp name="flighttime">#{params[:flight_time]}</stringProp>
      <stringProp name="rampUp">#{params[:rampup]}</stringProp>
      <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
        <boolProp name="LoopController.continue_forever">false</boolProp>
        <intProp name="LoopController.loops">-1</intProp>
      </elementProp>
    </kg.apc.jmeter.threads.SteppingThreadGroup>
  EOF
  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