Sha256: 03f07622632269304f493ce4ea0f673cb4756bc7e24216438933a0c9b63dd242

Contents?: true

Size: 725 Bytes

Versions: 12

Compression:

Stored size: 725 Bytes

Contents

module JmeterPerf
  class ExtendedDSL < DSL
    def thread_group(*args, &)
      params = args.shift || {}
      params = {count: params}.merge(args.shift || {}) if params.is_a?(Integer)
      params[:num_threads] = params[:count] || 1
      params[:ramp_time] = params[:rampup] || (params[:num_threads] / 2.0).ceil
      params[:start_time] = params[:start_time] || Time.now.to_i * 1000
      params[:end_time] = params[:end_time] || Time.now.to_i * 1000
      params[:duration] ||= 60
      params[:continue_forever] ||= false
      params[:loops] = -1 if params[:continue_forever]
      node = JmeterPerf::DSL::ThreadGroup.new(params)
      attach_node(node, &)
    end

    alias_method :threads, :thread_group
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
jmeter_perf-1.1.1 lib/jmeter_perf/extend/threads/thread_group.rb
jmeter_perf-1.1.0 lib/jmeter_perf/extend/threads/thread_group.rb
jmeter_perf-1.0.10 lib/jmeter_perf/extend/threads/thread_group.rb
jmeter_perf-1.0.9 lib/jmeter_perf/extend/threads/thread_group.rb
jmeter_perf-1.0.8 lib/jmeter_perf/extend/threads/thread_group.rb
jmeter_perf-1.0.7 lib/jmeter_perf/extend/threads/thread_group.rb
jmeter_perf-1.0.6 lib/jmeter_perf/extend/threads/thread_group.rb
jmeter_perf-1.0.5 lib/jmeter_perf/extend/threads/thread_group.rb
jmeter_perf-1.0.4 lib/jmeter_perf/extend/threads/thread_group.rb
jmeter_perf-1.0.2 lib/jmeter_perf/extend/threads/thread_group.rb
jmeter_perf-1.0.1 lib/jmeter_perf/extend/threads/thread_group.rb
jmeter_perf-1.0.0 lib/jmeter_perf/extend/threads/thread_group.rb