annotate stress_read.rb @ 25:726b2deadbe3

calc_sd.rb
author Nobuyasu
date Fri, 31 Jan 2014 04:51:45 +0900
parents 5ea96ce6a1c1
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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 require 'socket'
5ea96ce6a1c1 Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6
5ea96ce6a1c1 Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 schedule = ARGV[0].to_i
5ea96ce6a1c1 Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 time = Time.now.to_i
5ea96ce6a1c1 Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 sleepTime = schedule - time
5ea96ce6a1c1 Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 sleep(sleepTime)
5ea96ce6a1c1 Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11
5ea96ce6a1c1 Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 tms = Benchmark.measure {
5ea96ce6a1c1 Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 count = ARGV[1].to_i
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 }
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 puts tms.real
5ea96ce6a1c1 Added some files
Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19