#!/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 origdir=`pwd` 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 $origdir/$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} [[ $instance -gt 0 && $instance -lt 10 ]] || bail "can't find instance" # Set to a list of edge servers to poll for logs # edges="sn1-r720-a02-15 sn1-r720-a02-17 sn1-r720-a02-19" edges="" cp $origdir/nethogs.out . [[ -e $origdir/ps.out ]] && mv $origdir/ps.out . [[ -e $origdir/change_counter.out ]] && mv $origdir/change_counter.out . [[ -e $origdir/network.out ]] && mv $origdir/network.out . [[ -e $origdir/loadavg.out ]] && mv $origdir/loadavg.out . kill $(pgrep run_top) cp $origdir/logs/*slave* . gzip *slave*.out & # 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 for h in $edges do ep4="p4 -p $h:${instance}666 -u $p4user" $ep4 clients -e bruno* |cut -d " " -f 2| while read c; do $ep4 -c $c sizes -sh //$c/... >> client_sizes-$h.txt; done done echo $p4 configure show > config.out $p4 configure show > config.out sudo ls -l /p4/$instance/ >> config.out grep numActions $origdir/locust_files/p4benchutils.py >> config.out # record number of submitted changes start_chg=$(cat change_counter.out) end_chg=$($p4 changes -ssubmitted -m1 | cut -d" " -f2) chgs=$($p4 changes "@>$start_chg" | wc -l) echo "Submitted change start $start_chg end $end_chg" > changes.out echo "Count: $chgs" >> changes.out # Get logs from server instance(s) sudo mv /p4/$instance/logs/log . for h in $edges do scp $h:/p4/$instance/logs/log $h-edge.log ssh $h mv /p4/$instance/logs/log /p4/$instance/logs/log.old done # Analyse logs into sql db ~/bin/log2sql.py -d run log for h in $edges do [[ -e $h-edge.log ]] && ~/bin/log2sql.py -d run $h-edge.log 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. |