Mercurial > hg > Members > nobuyasu > jungle_benchmark
annotate stress_read_write_cassandra.rb @ 25:726b2deadbe3
calc_sd.rb
author | Nobuyasu |
---|---|
date | Fri, 31 Jan 2014 04:51:45 +0900 |
parents | 5ea96ce6a1c1 |
children |
rev | line source |
---|---|
3
5ea96ce6a1c1
Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 #!/usr/bin/ruby |
5ea96ce6a1c1
Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 |
5ea96ce6a1c1
Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 require 'net/http' |
5ea96ce6a1c1
Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 require 'benchmark' |
5ea96ce6a1c1
Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 |
5ea96ce6a1c1
Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 schedule = ARGV[0].to_i |
5ea96ce6a1c1
Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 time = Time.now.to_i |
5ea96ce6a1c1
Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 sleepTime = schedule - time |
5ea96ce6a1c1
Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 sleep(sleepTime) |
5ea96ce6a1c1
Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 |
5ea96ce6a1c1
Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 tms = Benchmark.measure { |
5ea96ce6a1c1
Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 count = ARGV[1].to_i |
5ea96ce6a1c1
Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 uri = URI.parse('http://bldsv12.cr.ie.u-ryukyu.ac.jp:8080/editMessage?bname=hello%20world&uuid=13814000-1dd2-11b2-93d6-02864ec060b6') |
5ea96ce6a1c1
Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14 count.times {|i| |
5ea96ce6a1c1
Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15 ret = Net::HTTP.get('bldsv12.cr.ie.u-ryukyu.ac.jp','/showBoardMessage?bname=hello%20world',8080) |
5ea96ce6a1c1
Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 res = Net::HTTP.post_form(uri, {:author =>'oshiro', :bname =>'hello world', :uuid =>'0', :key =>'0', :msg =>"fugafuga #{i}"}) |
5ea96ce6a1c1
Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
17 } |
5ea96ce6a1c1
Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
18 } |
5ea96ce6a1c1
Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
19 puts tms.real |
5ea96ce6a1c1
Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
20 |