Skip to content

Commit

Permalink
tests/make_graph: plot several functions in the same graph
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 9fd0d7e commit 2e97ac3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
27 changes: 17 additions & 10 deletions tests/make_graph
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ done | awk '
print }
' | sort -k7,7 -k1,1n > /tmp/data

while dialog --menu 'Choose function' \
25 95 100 \
$(cat /tmp/data | awk '{ print $7 }' | sort -u | awk '{ print $0, ++n }') \
2> /tmp/function
while dialog --separate-output \
--buildlist 'Choose functions' \
$lines $columns $lines \
$(cat /tmp/data | awk '{ print $7 }' | sort -u | awk '{ print $0, $0, "off" }') \
2> /tmp/functions
do
while dialog --radiolist 'Choose field' \
while dialog --radiolist \
'Choose field' \
12 20 5 \
1 flat on \
2 flat% off \
Expand All @@ -66,16 +68,21 @@ do
;;
esac

func_name=$(cat /tmp/function)
cat /tmp/data | awk "\$7 == \"$func_name\"" | tee /tmp/datasel | \
gnuplot -e "

plots=$(
for func_name in $(cat /tmp/functions)
do
echo \"\< awk \'\$7 == \\\"$func_name\\\"\' /tmp/data\" using 1:$field with lines title \"$func_name\",
done
)
gnuplot -e "
set terminal dumb size $columns $lines enhanced ansi256;
set title '$func_name';
set xlabel '# of events';
set y2label '$unit';
plot '-' using 1:$field with lines title '$func_name';
plot $plots;
pause -1;
"
"
read -p "Press Enter to continue"
done
done
2 changes: 1 addition & 1 deletion tests/start_profiler
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ profiler_cmd() {
go tool pprof -proto -sample_index=alloc_space -output results/$(date +%s)-${BALLOON_VERSION}-mem-alloc-space-top.pb.gz http://localhost:6060/debug/pprof/heap
go tool pprof -proto -sample_index=inuse_objects -output results/$(date +%s)-${BALLOON_VERSION}-mem-inuse-objects.pb.gz http://localhost:6060/debug/pprof/heap
go tool pprof -proto -sample_index=inuse_space -output results/$(date +%s)-${BALLOON_VERSION}-mem-inuse-space-top.pb.gz http://localhost:6060/debug/pprof/heap
go tool pprof -proto -seconds 30 -output results/$(date +%s)-${BALLOON_VERSION}-cpu-profile.pb.gz http://localhost:6060) 2>&1 > /dev/null
go tool pprof -proto -seconds 100 -output results/$(date +%s)-${BALLOON_VERSION}-cpu-profile.pb.gz http://localhost:6060) 2>&1 > /dev/null
sleep $PROFILING_RATE_HZ
done
}
Expand Down

0 comments on commit 2e97ac3

Please sign in to comment.