#!/bin/bash function bail () { echo "\nError: ${1:-Unknown Error}\n"; exit ${2:-1}; } # Analyse using next available directory #runid=${1:-Unset} #[[ $runid == "Unset" ]] && bail "Specify runid as parameter" last_run=$(ls run/ | sort -n | tail -1) runid=$((last_run+1)) rundir=run/$runid echo "Creating $rundir" # copy client logs just in case useful echo "Copying logs..." ansible-playbook -i hosts ansible/copy_logs.yml > /dev/null # For replicas #ansible-playbook -i hosts ansible/copy_monitor_logs.yml #ansible-playbook -i hosts ansible/stop_monitoring.yml mkdir $rundir config_file=$(ls -tr config_p4_* | tail -1) pushd $rundir cp ../../$config_file . p4port=`grep 666 $config_file | head -1 | sed -e 's/\s*port:\s*//' | sed -e 's/ \- //'` p4user=`grep user $config_file | sed -e 's/\s*user:\s*//'` p4="p4 -p $p4port -u $p4user " port=`echo "$p4port" | cut -d: -f2` instance=${port:0:1} cp ../../nethogs.out . [[ -e ../../ps.out ]] && mv ../../ps.out . [[ -e ../../network.out ]] && mv ../../network.out . kill $(pgrep run_top) #cp ../../iftop.out . #cp ../../logs/*nethogs.out . #cp ../../logs/*iftop.out . cp ../../logs/*slave* . # Record sizes of clients $p4 clients -e bruno* |cut -d " " -f 2| while read c; do $p4 -c $c sizes -sh //$c/... >> client_sizes.txt; done echo p4 -p $p4port -u $p4user configure show > config.out $p4 configure show > config.out sudo ls -l /p4/$instance/ >> config.out # Get logs from server instance(s) sudo mv /p4/$instance/logs/log . #sudo mv /remote/FB_DB/p4/rep/h02_$instance/logs/log rep1.log #sudo mv /remote/FB_DB/p4/rep/h03_$instance/logs/log rep2.log #sudo mv /remote/FB_DB/p4/rep/h04_$instance/logs/log rep3.log #sudo chmod +r rep*.log # Analyse logs into sql db ~/bin/log2sql.py -d run log #~/bin/log2sql.py -d run -s rep1.log #~/bin/log2sql.py -d run -s rep2.log #~/bin/log2sql.py -d run -s rep3.log #for f in *nethogs.out #do # echo $f # grep p4d $f | awk '{sum += $2; count += 1} END {printf "%d %0.0f %d\n", count, sum, sum/count}' #done popd ./sqlreport.sh $rundir
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#8 | 25669 | Robert Cowham | Refactored - move scripts to utils dir | ||
#7 | 25521 | Robert Cowham |
Install net-tools to get ifconfig. Expand explanation |
||
#6 | 25519 | Robert Cowham | Basically working | ||
#5 | 25449 | Robert Cowham |
Latest updates. Record changes |
||
#4 | 25448 | Robert Cowham | Tweak reporting for phases | ||
#3 | 25354 | Robert Cowham | Working with multiple edges | ||
#2 | 25353 | Robert Cowham | Monitor network at beginning and end of benchmark | ||
#1 | 25346 | Robert Cowham | Populate //stream/pure. |