#!/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*//'`
port=`echo "$p4port" | cut -d: -f2`
instance=${port:0:1}
cp ../../nethogs.out .
[[ -e ../../ps.out ]] && mv ../../ps.out .
kill $(pgrep run_top)
#cp ../../iftop.out .
#cp ../../logs/*nethogs.out .
#cp ../../logs/*iftop.out .
cp ../../logs/*slave* .
echo p4 -p $p4port -u $p4user configure show > config.out
p4 -p $p4port -u $p4user 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 | |
|---|---|---|---|---|---|
| #15 | 25529 | Robert Cowham |
Latest copy of files including docker compose setup. Merging //guest/robert_cowham/p4benchmark/pb/... to //guest/robert_cowham/p4benchmark/main/... |
||
| #14 | 24851 | Robert Cowham |
Improve sql reporting. Log ps usage |
||
| #13 | 24848 | Robert Cowham |
Drop caches per run. Increase num slaves to 70 |
||
| #12 | 24760 | Robert Cowham | Output sum column in sql report | ||
| #11 | 24743 | Robert Cowham | fix call to copy_logs | ||
| #10 | 24742 | Robert Cowham | Analyse correct yml files | ||
| #9 | 24723 | Robert Cowham | Fix sql reports | ||
| #8 | 24693 | Robert Cowham | Tidy sql output | ||
| #7 | 24690 | Robert Cowham |
Tweak analyse better. Fix deletion of workspaces root |
||
| #6 | 24687 | Robert Cowham | Got analysis working | ||
| #5 | 22003 | Robert Cowham | Latest state - with p4python and no syncing | ||
| #4 | 21903 | Robert Cowham | New edge servers | ||
| #3 | 21897 | Robert Cowham | Handle edge servers too | ||
| #2 | 21790 | Robert Cowham | New analyse for replica work | ||
| #1 | 21767 | Robert Cowham | add latest stuff with analyse |