Mercurial > hg > Members > toma > benchmark
changeset 5:91b6bf5c7a39
add write test
author | Daichi TOMA |
---|---|
date | Tue, 02 Jul 2013 18:11:52 +0900 |
parents | 081e4ac89157 |
children | e41cd57e8773 |
files | stress_write.rb stress_write.sh |
diffstat | 2 files changed, 38 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stress_write.rb Tue Jul 02 18:11:52 2013 +0900 @@ -0,0 +1,20 @@ +#!/usr/bin/ruby + +require 'net/http' +require 'uri' +require 'benchmark' + +schedule = ARGV[0].to_i +time = Time.now.to_i +sleepTime = schedule - time +sleep(sleepTime) + +tms = Benchmark.measure { + count = ARGV[1].to_i + count.times {|i| + URI.parse("http://133.13.56.3:3000/editMessage?bname=hello%20world&uuid=0") + Net::HTTP.post_form(uri, {'author' => 'shoshi', 'bname' => 'hello world', 'uuid' => '0', 'key' => '0', 'msg' => 'hogehoge'}) + } +} +puts tms.real +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/stress_write.sh Tue Jul 02 18:11:52 2013 +0900 @@ -0,0 +1,18 @@ +#!/bin/sh +# +#PBS -q tqueue +#PBS -N read_jungle_bldsv10 +#PBS -l walltime=00:05:00 + +script=/home/mass/share/student/k128569/benchmark/stress_write.rb + +function run() { + while read serv + do + ssh $serv "/usr/bin/ruby $script $schedule $times" & + done + wait +} + +uniq $PBS_NODEFILE /tmp/nodes +run < /tmp/nodes