Created
November 7, 2018 09:49
-
-
Save Dieterbe/8add09eeebca324e360afd2a21d66f61 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
log () { | |
echo "$(date +'%Y/%m/%d %H:%M:%S') $@" | |
} | |
for commit in $(cat commits); do | |
echo | |
log "doing $commit" | |
echo | |
git checkout $commit | |
make | |
./carbon-relay-ng dieter-configs/carbon-relay-ng.ini.anderender &> out-$commit.txt & | |
pid=$! | |
echo "pid is $pid" | |
> memory-$commit.txt | |
for i in {1..600}; do | |
sleep 1 | |
rss=$(ps --no-headers -o rss -p $pid | sed 's#$#000#') | |
heap=$(curl -s 'http://127.0.0.1:8082/debug/pprof/heap?debug=1' | awk '/HeapAlloc/ {print $NF}') | |
echo "$rss $heap" >> memory-$commit.txt | |
if [ $i -eq 1 -o $((i % 60)) -eq 0 ]; then | |
wget http://127.0.0.1:8082/debug/pprof/heap -O heap-$commit-$i | |
fi | |
done | |
kill $pid | |
gnuplot -p -e "set terminal png size 1280,720; set output '${commit}.png'; set format y '%.0s%cB'; plot 'memory-$commit.txt' using 1 title 'rss' with lines, 'memory-$commit.txt' using 2 title 'heap' with lines"; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment