require 'rake' runner = "ruby http_service3.rb" record = "stress.log" url = "http://localhost:3000/files/http_service3.rb" worker = "ab.exe" desc "this try to stress the registered service and log results to a file." task :stress do 5.times do |concurrency| 10.times do |attempt| sh %{echo *** attempt number #{attempt+1}, concurrency #{concurrency+1} >> #{record}} sh %{#{runner} start >> #{record}} sleep 10 sh %{#{worker} -c #{concurrency+1} -t 10 #{url} >> #{record}} sleep 10 sh %{#{runner} stop >> #{record}} sleep 10 end end end