Sha256: 8ed4685b16a8737b7a04dbad5b9675a9970b55caa21978e092314a669dc041d8

Contents?: true

Size: 720 Bytes

Versions: 3

Compression:

Stored size: 720 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::ThreadGroup.new(params)
      attach_node(node, &)
    end

    alias_method :threads, :thread_group
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
jmeter_perf-0.0.7 lib/jmeter_perf/extend/threads/thread_group.rb
jmeter_perf-0.0.6 lib/jmeter_perf/extend/threads/thread_group.rb
jmeter_perf-0.0.2 lib/jmeter_perf/extend/threads/thread_group.rb