Mercurial > hg > Members > nobuyasu > jungle_benchmark
changeset 18:358c96fab537
Added weighttp/test.sh
author | Nobuyasu |
---|---|
date | Wed, 29 Jan 2014 12:57:18 +0900 |
parents | 9ecbc7400fbb |
children | c28f8d47c60d |
files | distributed/capistrano_jungle.rb distributed/weighttp/test.sh |
diffstat | 2 files changed, 56 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/distributed/capistrano_jungle.rb Tue Jan 28 14:14:14 2014 +0900 +++ b/distributed/capistrano_jungle.rb Wed Jan 29 12:57:18 2014 +0900 @@ -1,10 +1,9 @@ set :user, "mass" -#role :pall00, "133.13.62.48" #role :pall00, "133.13.62.44","133.13.62.45","133.13.62.46","133.13.62.47" -role :pall00, "133.13.62.44","133.13.62.45","133.13.62.46" +role :pall00, "133.13.62.44" #role :pall00, "133.13.62.44","133.13.62.45","133.13.62.46","133.13.62.47","133.13.62.48" role :pall01, "133.13.62.39","133.13.62.40","133.13.62.41","133.13.62.42","133.13.62.43" role :pall02, "133.13.62.34","133.13.62.35","133.13.62.36","133.13.62.37","133.13.62.38" @@ -167,3 +166,11 @@ task :cp_snappy do run "cp /home/mass/share/student/k128576/cassandra/snappy-java-1.0.4.jar /home/mass/student/k128576/cassandra/apache-cassandra-2.0.4/lib/" end + +task :hostname10, :roles =>:pall00 do + run "hostname" +end + + + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/distributed/weighttp/test.sh Wed Jan 29 12:57:18 2014 +0900 @@ -0,0 +1,47 @@ +#!/bin/sh + +hostname=`hostname` +clientsFile=/home/mass/share/student/k128576/jungle_benchmark/distributed/weighttp/clients30.txt +nodesFile=/home/mass/share/student/k128576/jungle_benchmark/distributed/weighttp/nodes30.txt + +function get_host() { + hostNum=`/sbin/ifconfig | grep 'inet addr' | awk '{print $2;}' | awk 'NR==1'| cut -d. -f4 ` + myNum=$(($hostNum + 0)) + if test $myNum -gt 100 ; then + myNum=`expr $myNum - 100` + myNum=`expr $myNum + 18` + fi + nodeLength=0 + nodeArray=() + while read serv + do + nodeArray[$nodeLength]=$serv + nodeLength=`expr $nodeLength + 1` + done + myNodeNum=`expr $myNum % $nodeLength` + echo ${nodeArray[$myNodeNum]} + } + +#nodeArray=`get_host < $nodesFile` +#echo ${nodeArray[0]} + + +#cat ${clientsFile} | sed '/^$/d' | while read line + +function get_my_num() { + num=0 + myName=$1 + while read serv + do + if [ $serv = $myName ]; then + break + fi + num=`expr $num + 1` + done + echo $num +} + +myNum=`get_my_num < $clientsFile $hostname` +echo $myNum +url=`get_url < $nodesFile $myNum` +