Skip to content

Commit

Permalink
tests/make_graph: implement cache for /tmp/data
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Evgeniev <[email protected]>
  • Loading branch information
panchoh and suizman committed Dec 10, 2018
1 parent 2e97ac3 commit c445d70
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions tests/make_graph
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,23 @@ fi
dir="$1"
metric="$2"

for prof in $(find $dir -type f -name "*.pb.gz" | sort)
do
x=$(echo $prof | cut -d- -f2)
go tool pprof -top -unit ms "$prof" | awk '/%.*%.*%/ && NF == 6' | sed "s/^/$x /"
done | awk '
if [ ! -z "$(find "$dir" -name '*pb.gz' -newer /tmp/data)" ]; then
echo -n 'Refreshing /tmp/data...'
for prof in $(find $dir -type f -name "*.pb.gz" | sort)
do
x=$(echo $prof | cut -d- -f2)
go tool pprof -top -unit ms "$prof" | awk '/%.*%.*%/ && NF == 6' | sed "s/^/$x /"
done | awk '
{ sub("ms", "", $2);
sub("ms", "", $5);
sub("%", "", $3);
sub("%", "", $6);
print }
' | sort -k7,7 -k1,1n > /tmp/data
' | sort -k7,7 -k1,1n > /tmp/data
echo 'done.'
else
echo 'Using cached /tmp/data.'
fi

while dialog --separate-output \
--buildlist 'Choose functions' \
Expand Down Expand Up @@ -83,6 +89,5 @@ do
plot $plots;
pause -1;
"
read -p "Press Enter to continue"
done
done

0 comments on commit c445d70

Please sign in to comment.