#!/bin/bash
function bail () { echo "\nError: ${1:-Unknown Error}\n"; exit ${2:-1}; }
runid=${1:-Unset}
[[ $runid == "Unset" ]] && bail "Specify runid as parameter"
rundir=run/$runid
# For replicas
#ansible-playbook -i hosts copy_monitor_logs.yml
#ansible-playbook -i hosts stop_monitoring.yml
mkdir $rundir
config_file=config_p4_bench.yml
cd $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 .
#cp ../../iftop.out .
#cp ../../logs/*nethogs.out .
#cp ../../logs/*iftop.out .
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
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
~/bin/log2sql.py -d run log
#python3.6 ~/bin/log2sql.py -d run -s rep1.log
#python3.6 ~/bin/log2sql.py -d run -s rep2.log
#python3.6 ~/bin/log2sql.py -d run -s rep3.log
# cat config*
sqlite3 -header run.db <<EOF
.mode column
select cmd, count(cmd),
round(cast(avg(completedLapse) AS DECIMAL(9,2)), 2) as "Avg Time",
round(cast(max(completedLapse) AS DECIMAL(9, 2)), 2) as "Max Time"
from process
group by cmd;
select cmd, count(cmd), round(cast(avg(completedLapse) AS DECIMAL(9,2)), 2) as "Avg Time",
round(cast(max(completedLapse) AS DECIMAL(9, 2)), 2) as "Max Time",
cast(sum(completedLapse) as decimal(9,2)) as "Sum Time",
round(cast(avg(rpcsizeout) AS DECIMAL(9,2)), 2) as "Avg Sent(MB)",
cast(sum(rpcsizeout) AS DECIMAL(9,2)) as "Sum Sent(MB)",
round(cast(sum(rpcsizeout) as decimal(9,2)) / cast(sum(completedLapse) as decimal(9,2)), 2) as "Rate MB/s"
FROM process where (cmd = "user-sync") and completedLapse > 1;
select min(substr(starttime, 13, 8)), max(substr(endtime, 13, 8)), count(completedlapse) from process where cmd = "user-sync" and completedlapse > 1;
EOF
#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
| # | 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 |