Sha256: e0fd2b981f2dea254caf7c0981d80e6c9ec0921e6526e91fedab5b13353017f0

Contents?: true

Size: 855 Bytes

Versions: 2

Compression:

Stored size: 855 Bytes

Contents

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

  class GaussianRandomTimer
    attr_accessor :doc
    include Helper

    def initialize(params = {})
      testname = params.is_a?(Array) ? "GaussianRandomTimer" : (params[:name] || "GaussianRandomTimer")
      @doc = Nokogiri::XML(<<~EOS.strip_heredoc)
        <GaussianRandomTimer guiclass="GaussianRandomTimerGui" testclass="GaussianRandomTimer" testname="#{testname}" enabled="true">
          <stringProp name="ConstantTimer.delay">300</stringProp>
          <stringProp name="RandomTimer.range">100.0</stringProp>
        </GaussianRandomTimer>
      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/gaussian_random_timer.rb
jmeter_perf-0.0.2 lib/jmeter_perf/dsl/gaussian_random_timer.rb