Sha256: a7ee825c7619061f460513bde91a7b6b94a7accf6770a6a4dba4475db08a3fa4

Contents?: true

Size: 1.08 KB

Versions: 36

Compression:

Stored size: 1.08 KB

Contents

module RubyJmeter
  module Plugins
    class ThroughputShapingTimer
      attr_accessor :doc
      include Helper
      def initialize(name, steps, params={})
        @doc = Nokogiri::XML(<<-EOF.strip_heredoc)
          <kg.apc.jmeter.timers.VariableThroughputTimer guiclass="kg.apc.jmeter.timers.VariableThroughputTimerGui" testclass="kg.apc.jmeter.timers.VariableThroughputTimer" testname="#{name}" enabled="true">
            <collectionProp name="load_profile"/>
          </kg.apc.jmeter.timers.VariableThroughputTimer>
        EOF
        steps.each_with_index do |step, index|
          @doc.at_xpath('//collectionProp') <<
            Nokogiri::XML(<<-EOF.strip_heredoc).children
              <collectionProp name="step_#{index}">
                <stringProp name="start_rps_#{index}">#{step[:start_rps]}</stringProp>
                <stringProp name="end_rps_#{index}">#{step[:end_rps]}</stringProp>
                <stringProp name="duration_sec_#{index}">#{step[:duration]}</stringProp>
              </collectionProp>
            EOF
        end
        update params
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
ruby-jmeter-3.0.6 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-3.0.5 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-3.0.4 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-3.0.3 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-3.0.2 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-3.0.1 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-3.0.0 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-2.13.10 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-2.13.9 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-2.13.8 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-2.13.7 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-2.13.6 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-2.13.5 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-2.13.4 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-2.13.3 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-2.13.2 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-2.13.1 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-2.13.0 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-2.12.5 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-2.12.4 lib/ruby-jmeter/plugins/variable_throughput_timer.rb