Sha256: 5781ef86ad602358340b76bbfc8850952e74736bf4124070f9bdb5f081330f9f

Contents?: true

Size: 844 Bytes

Versions: 2

Compression:

Stored size: 844 Bytes

Contents

module JmeterPerf
  class DSL
    def uniform_random_timer(params = {}, &)
      node = JmeterPerf::UniformRandomTimer.new(params)
      attach_node(node, &)
    end
  end

  class UniformRandomTimer
    attr_accessor :doc
    include Helper

    def initialize(params = {})
      testname = params.is_a?(Array) ? "UniformRandomTimer" : (params[:name] || "UniformRandomTimer")
      @doc = Nokogiri::XML(<<~EOS.strip_heredoc)
        <UniformRandomTimer guiclass="UniformRandomTimerGui" testclass="UniformRandomTimer" testname="#{testname}" enabled="true">
          <stringProp name="ConstantTimer.delay">0</stringProp>
          <stringProp name="RandomTimer.range">100.0</stringProp>
        </UniformRandomTimer>
      EOS
      update params
      update_at_xpath params if params.is_a?(Hash) && params[:update_at_xpath]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jmeter_perf-0.0.6 lib/jmeter_perf/dsl/uniform_random_timer.rb
jmeter_perf-0.0.2 lib/jmeter_perf/dsl/uniform_random_timer.rb