annotate stress_write_jungle.rb @ 16:704bcc773b96

Modifed capistrano file
author Nobuyasu
date Fri, 24 Jan 2014 18:09:16 +0900
parents 223af50e60d5
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'
10
f94fc7812cd8 Modified benchmark program
Nobuyasu
parents: 0
diff changeset
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
f94fc7812cd8 Modified benchmark program
Nobuyasu
parents: 0
diff changeset
7 schedule = ARGV[0].to_i
f94fc7812cd8 Modified benchmark program
Nobuyasu
parents: 0
diff changeset
8 time = Time.now.to_i
f94fc7812cd8 Modified benchmark program
Nobuyasu
parents: 0
diff changeset
9 sleepTime = schedule - time
f94fc7812cd8 Modified benchmark program
Nobuyasu
parents: 0
diff changeset
10 sleep(sleepTime)
f94fc7812cd8 Modified benchmark program
Nobuyasu
parents: 0
diff changeset
11
0
f049a3340d2c added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 r = Benchmark.measure {
10
f94fc7812cd8 Modified benchmark program
Nobuyasu
parents: 0
diff changeset
13 count = ARGV[1].to_i
11
223af50e60d5 Added some files
Nobuyasu
parents: 10
diff changeset
14 # uri = URI.parse('http://bldsv12.cr.ie.u-ryukyu.ac.jp:8080/editMessage?bname=hello%20world&uuid=0')
223af50e60d5 Added some files
Nobuyasu
parents: 10
diff changeset
15 uri = URI.parse('http://mass48.cs.ie.u-ryukyu.ac.jp:8080/editMessage?bname=hello%20world&uuid=0')
10
f94fc7812cd8 Modified benchmark program
Nobuyasu
parents: 0
diff changeset
16 count.times {|i|
f94fc7812cd8 Modified benchmark program
Nobuyasu
parents: 0
diff changeset
17 res = Net::HTTP.post_form(uri, {:author =>'oshiro', :bname =>'hello world', :uuid =>'0', :key =>'0', :msg =>"hogehoge #{i}"})
f94fc7812cd8 Modified benchmark program
Nobuyasu
parents: 0
diff changeset
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
f94fc7812cd8 Modified benchmark program
Nobuyasu
parents: 0
diff changeset
21