Skip to content

Instantly share code, notes, and snippets.

@Strech
Last active December 20, 2015 01:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Strech/6051800 to your computer and use it in GitHub Desktop.
Save Strech/6051800 to your computer and use it in GitHub Desktop.
yandex-tank ruby-generator sample
# code: utf-8
# Usage: ruby generator.rb > ammo.txt
DELIMITER = "\r\n".freeze
template = [
"GET / HTTP/1.1",
"User-Agent: tank",
"Host: 127.0.0.1:3000", # or something else
"Connection: close",
DELIMITER
] * DELIMITER
10.times do |n|
request = template.dup # dup for next modifications if needed
puts "#{request.length}\n#{request}\r\n" # https://github.com/yandex-load/yandex-tank#request-style
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment