Sha256: 02788c9d862752d46963d9b740cb49244df560296f4219941f880759390fc520

Contents?: true

Size: 1.79 KB

Versions: 3

Compression:

Stored size: 1.79 KB

Contents

module JmeterPerf
  module Plugins
    class SteppingThreadGroup
      attr_accessor :doc
      include Helper
      def initialize(params = {})
        testname = params.is_a?(Array) ? "SteppingThreadGroup" : (params[:name] || "SteppingThreadGroup")
        @doc = Nokogiri::XML(<<-EOF.strip_heredoc)
          <kg.apc.jmeter.threads.SteppingThreadGroup guiclass="kg.apc.jmeter.threads.SteppingThreadGroupGui" testclass="kg.apc.jmeter.threads.SteppingThreadGroup" testname="#{testname}" 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
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jmeter_perf-0.0.7 lib/jmeter_perf/plugins/stepping_thread_group.rb
jmeter_perf-0.0.6 lib/jmeter_perf/plugins/stepping_thread_group.rb
jmeter_perf-0.0.2 lib/jmeter_perf/plugins/stepping_thread_group.rb