Created
July 4, 2012 12:38
-
-
Save nas/3047128 to your computer and use it in GitHub Desktop.
Apache Bench
This file contains hidden or 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
#! /usr/bin/ruby | |
raise "Provide the dir path" unless ARGV[0] =~ /[a-z]*/ | |
to_dir = ARGV[0].strip | |
raise "Provide the dir path" if to_dir.nil? | |
site = 'http://url' | |
print "Processing home page ... " | |
system("ab -n 100 -c 10 #{site}/ > benchmark/#{to_dir}/home_page") | |
puts "Done" | |
%w{page_1 page_2 page_3}.each do |page| | |
page_name = page.capitalize.sub('_', ' ') | |
print "Processing #{page_name} page ... " | |
system("ab -n 100 -c 10 #{site}/#{page} > benchmark/#{to_dir}/#{page}") | |
puts "Done" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment