Sha256: 465ab8c1a20616c5787afc3100d670eaf3c1d23866cf2924e8b1d7b151e7a1ba

Contents?: true

Size: 1.23 KB

Versions: 15

Compression:

Stored size: 1.23 KB

Contents

module RubyJmeter
  module Plugins
    class ThroughputShapingTimer
      attr_accessor :doc
      include Helper
      def initialize(params={})
        testname = params.kind_of?(Array) ? 'ThroughputShapingTimer' : (params[:name] || 'ThroughputShapingTimer')
        @doc = Nokogiri::XML(<<-EOF.strip_heredoc)
          <kg.apc.jmeter.timers.VariableThroughputTimer guiclass="kg.apc.jmeter.timers.VariableThroughputTimerGui" testclass="kg.apc.jmeter.timers.VariableThroughputTimer" testname="#{testname}" enabled="true">
            <collectionProp name="load_profile"/>
          </kg.apc.jmeter.timers.VariableThroughputTimer>
        EOF
        (params.kind_of?(Array) ? params : params[: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

15 entries across 15 versions & 1 rubygems

Version Path
ruby-jmeter-3.1.08 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-3.1.07 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-3.1.06 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-3.1.05 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-3.1.04 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-3.1.03 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-3.1.02 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-3.1.01 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-3.0.13 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-3.0.12 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-3.0.11 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-3.0.10 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-3.0.9 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-3.0.8 lib/ruby-jmeter/plugins/variable_throughput_timer.rb
ruby-jmeter-3.0.7 lib/ruby-jmeter/plugins/variable_throughput_timer.rb