view distributed/weighttp/stress_weighttp.sh @ 21:a972a5814b0b

loop_qsub.sh for jungle benchmark
author Nobuyasu
date Wed, 29 Jan 2014 16:22:02 +0900
parents 61221984aa56
children d6d3b7180e6d
line wrap: on
line source

#!/bin/sh

export LD_LIBRARY_PATH=/usr/local/lib 
hostname=`hostname`
myNum=$1
nodesFile=$2
schedule=$3
requestNum=$4
concurrent=$5
threadNum=$6

function get_node_name() {
    num=$1
    nodeLength=0    
    nodeArray=()
    while read serv
    do
     nodeArray[$nodeLength]=$serv
     nodeLength=`expr $nodeLength + 1`
    done
    echo ${nodeArray[$num]}
}

nodeUrl=`get_node_name < $nodesFile $myNum`
uri=":8080/editMessageUseGet?bname=hello%20world&uuid=0&author=oshiro&msg=write_test&key="
now=$(date +%s)
sleepTime=`expr $schedule - $now`
sleep $sleepTime
ret=`/home/mass/student/k128576/opt/bin/weighttp -n $requestNum -c $concurrent -t $threadNum -k $nodeUrl$uri`
time=`echo $ret | awk '{print $62 " " $63 " " $82 " " $83}' `
echo $nodeUrl$uri
echo $time