#!/usr/bin/bash
sudo pkill -9 nethogs
tpid=$(pgrep run_top)
[[ $tpid -eq 0 ]] || kill $tpid
NETWORK_LOG=network.out
[[ -e nethogs.out ]] && sudo rm nethogs.out
[[ -e ps.out ]] && sudo rm ps.out
[[ -e $NETWORK_LOG ]] && sudo rm $NETWORK_LOG
num_slaves=$(grep "num_slaves" hosts | awk '{print $2}')
# nohup sudo nethogs -c 800 -t -d 10 > nethogs.out 2>&1 &
nohup ./run_top.sh > ps.out 2>&1 &
nics="bond0 enp66s0 enp66s0d1"
echo "Start of benchmark" >> $NETWORK_LOG
date +"%Y-%m-%dT%H-%M-%SZ" >> $NETWORK_LOG
for nic in $nics
do
ifconfig $nic >> $NETWORK_LOG
done
sleep 10
config_file=$(ls -tr config_p4_* | tail -1)
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 "
while true
do
# count=$(ps ax | grep p4d_ | grep -v grep | wc -l)
count=$($p4 monitor show | grep -v monitor | grep -v rmt-Journal | wc -l)
[[ $count -eq 0 ]] && echo -e "\n\nBenchmark has finished!!\n\n" && break
sleep 10
done
echo "End of benchmark" >> $NETWORK_LOG
date +"%Y-%m-%dT%H-%M-%SZ" >> $NETWORK_LOG
for nic in $nics
do
ifconfig $nic >> $NETWORK_LOG
done
sudo pkill -9 nethogs
kill $(pgrep run_top)
| # | Change | User | Description | Committed | |
|---|---|---|---|---|---|
| #6 | 25669 | Robert Cowham | Refactored - move scripts to utils dir | ||
| #5 | 25520 | Robert Cowham |
Tidied up. Created 2 client workspaces |
||
| #4 | 25449 | Robert Cowham |
Latest updates. Record changes |
||
| #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. |