Class: JmeterPerf::Plugins::SteppingThreadGroup

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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
28
29
30
31
# File 'lib/jmeter_perf/plugins/stepping_thread_group.rb', line 6

def initialize(params = {})
  testname = params.is_a?(Array) ? "SteppingThreadGroup" : (params[:name] || "SteppingThreadGroup")
  @doc = Nokogiri::XML(
    JmeterPerf::Helpers::String.strip_heredoc(
      "        <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      EOF\n    )\n  )\n  update params\nend\n"

Instance Attribute Details

#docObject

Returns the value of attribute doc.



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

def doc
  @doc
end