Mercurial > hg > Members > nobuyasu > jungle_benchmark
changeset 24:4bc7b8835f56
Added parse_log
author | Nobuyasu |
---|---|
date | Fri, 31 Jan 2014 00:51:16 +0900 |
parents | 446a5c242cc7 |
children | 726b2deadbe3 |
files | distributed/weighttp/parse_log.rb distributed/weighttp/weighttp_jungle.sh |
diffstat | 2 files changed, 83 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/distributed/weighttp/parse_log.rb Fri Jan 31 00:51:16 2014 +0900 @@ -0,0 +1,40 @@ +#!/usr/local/bin/ruby + +if ARGV.size() < 1 then + puts "Usage:ruby parse_log.rb filename" + exit +end + +def grep_line(filename) + lineArray = File.open(filename,'r') do |file| + file.readlines.select{|line| line =~ /sec/ } + end + return lineArray +end + +def convert_log(filename) + lineArray = grep_line(filename) + totalFailed = 0 + timeArray = [] + lineArray.each {|line| + tokens = line.split(' ') + sec = tokens[0].to_i * 1000 + millsec = tokens[2].to_i + time = sec + millsec + timeArray.push(time) + totalFailed = totalFailed + tokens[4].to_i + } + if totalFailed != 0 then + puts "Fails " + totalFailed.to_s + end + size = timeArray.size().to_s + timeArray.each{|time| puts size + " " + time.to_s } +end + +puts "Unit of time is millisecond" +ARGV.each {|filename| + convert_log(filename) +} + + +
--- a/distributed/weighttp/weighttp_jungle.sh Thu Jan 30 23:31:30 2014 +0900 +++ b/distributed/weighttp/weighttp_jungle.sh Fri Jan 31 00:51:16 2014 +0900 @@ -1,46 +1,58 @@ #!/bin/sh function usage() { - echo "Please set number of node and mode" - echo "Usage:./loop_qsub.sh nodenum [mode]" - echo "[mode]: read write" - exit 1 + echo "Please set number of node and mode" + echo "Usage:./loop_qsub.sh nodenum [mode]" + echo "[mode]: read write" + exit 1 } if [ $# -lt 2 ]; then - usage + usage fi readFlag=1 if [ $2 == "read" ] -then - readFlag=1 + then + readFlag=1 elif [ $2 == "write" ] -then - readFlag=0 + then + readFlag=0 else - usage + usage fi +#requestNum=50000 +#concurrentNum=200 +#threadNum=2 + +requestNum=5000 +concurrentNum=1 +threadNum=1 + +echo "number of loop : $loopnum" +echo "requests:$requestNum concurrent:$concurrentNum thread:$threadNum" nodesFile=/home/mass/share/student/k128576/jungle_benchmark/distributed/weighttp/nodes30.txt - nodenum=$1 -if [ $nodenum -lt 10 ] -then - nodenum=0$nodenum -fi -echo "nodes = $nodenum" -if [ $readFlag -eq 0 ] - echo "write benchmark" - qsub -e /home/mass/share/student/k128576/jungle_benchmark/distributed/weighttp/jungle_log/error_log/ -o /home/mass/share/student/k128576/jungle_benchmark/distributed/weighttp/jungle_log/log/ -v nodesFile=$nodesFile,requests=50000,schedule=`expr $(date +%s) + 10`,concurrent=200,thread=2 -l nodes=$nodenum:ppn=4 /home/mass/share/student/k128576/jungle_benchmark/distributed/weighttp/weighttp_write_jungle.sh -then -else - echo "read benchmark" - qsub -e /home/mass/share/student/k128576/jungle_benchmark/distributed/weighttp/jungle_log/error_log/ -o /home/mass/share/student/k128576/jungle_benchmark/distributed/weighttp/jungle_log/log/ -v nodesFile=$nodesFile,requests=50000,schedule=`expr $(date +%s) + 10`,concurrent=200,thread=2 -l nodes=$nodenum:ppn=4 /home/mass/share/student/k128576/jungle_benchmark/distributed/weighttp/weighttp_read_jungle.sh -fi +for i in `seq 1 $loopnum` + do + echo "current count = $i" + if [ $nodenum -lt 10 ] + then + nodenum=0$nodenum + fi + echo "nodes = $nodenum" + if [ $readFlag -eq 0 ] + echo "write benchmark" + qsub -e /home/mass/share/student/k128576/jungle_benchmark/distributed/weighttp/jungle_log/error_log/ -o /home/mass/share/student/k128576/jungle_benchmark/distributed/weighttp/jungle_log/log/ -v nodesFile=$nodesFile,requests=$requestNum,schedule=`expr $(date +%s) + 10`,concurrent=$concurrentNum,thread=$threadNum -l nodes=$nodenum:ppn=4 /home/mass/share/student/k128576/jungle_benchmark/distributed/weighttp/weighttp_write_jungle.sh + then + else + echo "read benchmark" + qsub -e /home/mass/share/student/k128576/jungle_benchmark/distributed/weighttp/jungle_log/error_log/ -o /home/mass/share/student/k128576/jungle_benchmark/distributed/weighttp/jungle_log/log/ -v nodesFile=$nodesFile,requests=$requestNum,schedule=`expr $(date +%s) + 10`,concurrent=$concurrentNum,thread=$threadNum -l nodes=$nodenum:ppn=4 /home/mass/share/student/k128576/jungle_benchmark/distributed/weighttp/weighttp_read_jungle.sh + fi -while [ "x`qstat`" != "x" ] -do - echo "waiting for job to complete" - sleep 5 -done -echo "job complete" - + while [ "x`qstat`" != "x" ] + do + echo "waiting for job to complete" + sleep 5 + done + echo "job complete" +done