Mercurial > hg > Members > nobuyasu > jungle_benchmark
view stress_write_jungle.rb @ 14:77a01d4fca04
capistrano file
author | Nobuyasu |
---|---|
date | Tue, 21 Jan 2014 09:28:28 +0900 |
parents | 223af50e60d5 |
children |
line wrap: on
line source
#!/usr/bin/ruby require 'net/http' require 'uri' require 'benchmark' schedule = ARGV[0].to_i time = Time.now.to_i sleepTime = schedule - time sleep(sleepTime) r = Benchmark.measure { count = ARGV[1].to_i # uri = URI.parse('http://bldsv12.cr.ie.u-ryukyu.ac.jp:8080/editMessage?bname=hello%20world&uuid=0') uri = URI.parse('http://mass48.cs.ie.u-ryukyu.ac.jp:8080/editMessage?bname=hello%20world&uuid=0') count.times {|i| res = Net::HTTP.post_form(uri, {:author =>'oshiro', :bname =>'hello world', :uuid =>'0', :key =>'0', :msg =>"hogehoge #{i}"}) } } puts r.real