Class: JmeterPerf::Plugins::UltimateThreadGroup

Inherits:
Object
  • Object
show all
Includes:
Helpers::XmlDocumentUpdater
Defined in:
lib/jmeter_perf/plugins/ultimate_thread_group.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ UltimateThreadGroup

Returns a new instance of UltimateThreadGroup.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/jmeter_perf/plugins/ultimate_thread_group.rb', line 6

def initialize(params = {})
  testname = params.is_a?(Array) ? "UltimateThreadGroup" : (params[:name] || "UltimateThreadGroup")
  @doc = Nokogiri::XML(
    JmeterPerf::Helpers::String.strip_heredoc(
      <<-EOF
        <kg.apc.jmeter.threads.UltimateThreadGroup guiclass="kg.apc.jmeter.threads.UltimateThreadGroupGui" testclass="kg.apc.jmeter.threads.UltimateThreadGroup" testname="#{testname}" enabled="true">
        <collectionProp name="ultimatethreadgroupdata">
        </collectionProp>
        <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>
        <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
      </kg.apc.jmeter.threads.UltimateThreadGroup>
      EOF
    )
  )

  update params
end

Instance Attribute Details

#docObject

Returns the value of attribute doc.



4
5
6
# File 'lib/jmeter_perf/plugins/ultimate_thread_group.rb', line 4

def doc
  @doc
end