Mercurial > hg > Members > nobuyasu > jungle_benchmark
annotate stress_write_jungle.rb @ 16:704bcc773b96
Modifed capistrano file
author | Nobuyasu |
---|---|
date | Fri, 24 Jan 2014 18:09:16 +0900 |
parents | 223af50e60d5 |
children |
rev | line source |
---|---|
0
f049a3340d2c
added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 #!/usr/bin/ruby |
f049a3340d2c
added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 |
f049a3340d2c
added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 require 'net/http' |
10 | 4 require 'uri' |
0
f049a3340d2c
added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 require 'benchmark' |
f049a3340d2c
added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 |
10 | 7 schedule = ARGV[0].to_i |
8 time = Time.now.to_i | |
9 sleepTime = schedule - time | |
10 sleep(sleepTime) | |
11 | |
0
f049a3340d2c
added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 r = Benchmark.measure { |
10 | 13 count = ARGV[1].to_i |
11 | 14 # uri = URI.parse('http://bldsv12.cr.ie.u-ryukyu.ac.jp:8080/editMessage?bname=hello%20world&uuid=0') |
15 uri = URI.parse('http://mass48.cs.ie.u-ryukyu.ac.jp:8080/editMessage?bname=hello%20world&uuid=0') | |
10 | 16 count.times {|i| |
17 res = Net::HTTP.post_form(uri, {:author =>'oshiro', :bname =>'hello world', :uuid =>'0', :key =>'0', :msg =>"hogehoge #{i}"}) | |
18 } | |
0
f049a3340d2c
added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
19 } |
f049a3340d2c
added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
20 puts r.real |
10 | 21 |