vagrant tests eg with evhtp

This commit is contained in:
Olof Hagsand 2020-07-10 12:33:30 +00:00
parent efc0228f99
commit 53deedc242
8 changed files with 317 additions and 138 deletions

26
test/vagrant/mem.sh Executable file
View file

@ -0,0 +1,26 @@
#!/usr/bin/env bash
reset='\033[0m'
# White Background
BG='\033[47m'
# Black Foreground
FG='\033[0;30m'
printf "%+5s %+6s %+6s %s\n" PID VIRT RES VBOX
pids=$(ps -eo pid,cmd | grep VBoxHeadless |awk '{print $1}')
for pid in $pids; do
# echo "ps -o rss,vsize,cmd -h -p $pid"
line=$(ps -o rss,vsize,cmd -h -p $pid)
if [ -z "$line" ]; then
continue;
fi
rss=$(echo "$line"| awk '{print $1}')
let rss=rss/1000
virt=$(echo "$line"| awk '{print $2}')
let virt=virt/1000
rest=$(echo "$line"| sed 's/^.*--comment//' | sed 's/ --startvm.*$//' | awk -F- '{print $1 "-" $2}')
printf "%+5s %+5sM %+5sM %s\n" $pid $virt $rss $rest
done