Last active
December 20, 2015 01:49
yandex-tank ruby-generator sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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