annotate stress_write_cassandra.rb @ 13:e3fe67fee803

adde hello_post.rb
author Nobuyasu
date Mon, 20 Jan 2014 17:01:44 +0900
parents d4f55fd47603
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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'
f049a3340d2c added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 require 'benchmark'
f049a3340d2c added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
2
d4f55fd47603 Modified loop_qsub.sh
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
6 schedule = ARGV[0].to_i
d4f55fd47603 Modified loop_qsub.sh
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
7 time = Time.now.to_i
d4f55fd47603 Modified loop_qsub.sh
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
8 sleepTime = schedule - time
d4f55fd47603 Modified loop_qsub.sh
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
9 sleep(sleepTime)
d4f55fd47603 Modified loop_qsub.sh
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
10
d4f55fd47603 Modified loop_qsub.sh
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
11 tms = Benchmark.measure {
d4f55fd47603 Modified loop_qsub.sh
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
12 count = ARGV[1].to_i
d4f55fd47603 Modified loop_qsub.sh
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
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')
d4f55fd47603 Modified loop_qsub.sh
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
14 count.times {|i|
d4f55fd47603 Modified loop_qsub.sh
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
15 res = Net::HTTP.post_form(uri, {:author =>'oshiro', :bname =>'hello world', :uuid =>'0', :key =>'0', :msg =>"fugafuga #{i}"})
0
f049a3340d2c added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 }
f049a3340d2c added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 }
2
d4f55fd47603 Modified loop_qsub.sh
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
18 puts tms.real
d4f55fd47603 Modified loop_qsub.sh
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
19