Mercurial > hg > Members > nobuyasu > jungle_benchmark
view stress_read_write_cassandra.rb @ 18:358c96fab537
Added weighttp/test.sh
author | Nobuyasu |
---|---|
date | Wed, 29 Jan 2014 12:57:18 +0900 |
parents | 5ea96ce6a1c1 |
children |
line wrap: on
line source
#!/usr/bin/ruby require 'net/http' require 'benchmark' schedule = ARGV[0].to_i time = Time.now.to_i sleepTime = schedule - time sleep(sleepTime) tms = Benchmark.measure { count = ARGV[1].to_i uri = URI.parse('http://bldsv12.cr.ie.u-ryukyu.ac.jp:8080/editMessage?bname=hello%20world&uuid=13814000-1dd2-11b2-93d6-02864ec060b6') count.times {|i| ret = Net::HTTP.get('bldsv12.cr.ie.u-ryukyu.ac.jp','/showBoardMessage?bname=hello%20world',8080) res = Net::HTTP.post_form(uri, {:author =>'oshiro', :bname =>'hello world', :uuid =>'0', :key =>'0', :msg =>"fugafuga #{i}"}) } } puts tms.real