Skip to content

Commit

Permalink
Update bench shell
Browse files Browse the repository at this point in the history
  • Loading branch information
panjf2000 committed Jul 23, 2021
1 parent 832fdda commit 5408fba
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions bench-echo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ function go_bench() {
echo "--- $1 ---"
echo ""
if [[ "$1" == "GNET" ]]; then
go build -tags=poll_opt -gcflags="-l=4" -ldflags="-s -w" -o $2 $3
go build -tags=poll_opt -gcflags="-l=4" -ldflags="-s -w" -o "$2" "$3"
else
go build -gcflags="-l=4" -ldflags="-s -w" -o $2 $3
go build -gcflags="-l=4" -ldflags="-s -w" -o "$2" "$3"
fi

if [[ "$1" == "GO-NET" ]]; then
Expand All @@ -48,10 +48,14 @@ function go_bench() {
$2 --port "$4" --loops "$5" &
fi

sleep 1
printf "*** %d connections, %d seconds, packet size: %d bytes\n" $conn_num $test_duration $packet_size
echo "Warming up for 3 seconds..."
sleep 3
echo ""

echo "--- START ---"
printf "*** %d connections, %d seconds, packet size: %d bytes\n" "$conn_num" "$test_duration" "$packet_size"

tcpkali -c "$conn_num" -T "$test_duration"'s' -m "$packet" 127.0.0.1:$4
tcpkali -c "$conn_num" -T "$test_duration"'s' -m "$packet" 127.0.0.1:"$4"
echo ""
echo "--- DONE ---"
echo ""
Expand Down

0 comments on commit 5408fba

Please sign in to comment.