Sha256: 3ddb7e70a1086d06145304f7fabee0ca79f2d253cf7827960d37ffcf5d08eb95

Contents?: true

Size: 416 Bytes

Versions: 11

Compression:

Stored size: 416 Bytes

Contents

def rand_str(len)
  return (0...len).map { (65 + rand(26)).chr }.join
end

def generate_hash(widths)
  result = {}
  if widths.empty?
    return rand_str(20)
  else
    widths[0].times do
      result[rand_str(9)] = generate_hash(widths[1..widths.length])
    end
    return result
  end
end

def generate_data_array_for_spec(spec)
  data = []
  ITERATIONS.times do
    data << generate_hash(spec)
  end

  data
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
logstash-output-scalyr-0.2.7.beta spec/benchmarks/util.rb
logstash-output-scalyr-0.2.6 spec/benchmarks/util.rb
logstash-output-scalyr-0.2.6.beta spec/benchmarks/util.rb
logstash-output-scalyr-0.2.5.beta spec/benchmarks/util.rb
logstash-output-scalyr-0.2.4.beta spec/benchmarks/util.rb
logstash-output-scalyr-0.2.3 spec/benchmarks/util.rb
logstash-output-scalyr-0.2.2 spec/benchmarks/util.rb
logstash-output-scalyr-0.2.1.beta spec/benchmarks/util.rb
logstash-output-scalyr-0.2.0 spec/benchmarks/util.rb
logstash-output-scalyr-0.2.0.beta spec/benchmarks/util.rb
logstash-output-scalyr-0.1.26.beta spec/benchmarks/util.rb