Remove duplicates in server_pid

This commit is contained in:
Tyler Benson 2018-03-23 10:55:39 +08:00
parent d9f4e134f6
commit fb07fb41b4
1 changed files with 2 additions and 3 deletions

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# A script for measuring a server's throughput with or without a java agent.
test_csv_file=/tmp/perf_results.csv
@ -8,7 +8,6 @@ agent_jars="${@:2}"
server_pid=""
agent_pid=$(lsof -i tcp:8126 | awk '$8 == "TCP" { print $2 }')
if [ "$server_jar" = "" ]; then
echo "usage: ./run-perf-test.sh path-to-server-jar path-to-agent1 path-to-agent2..."
echo ""
@ -57,7 +56,7 @@ function start_server {
until nc -z localhost 8080; do
sleep 0.5
done
server_pid=$(lsof -i tcp:8080 | awk '$8 == "TCP" { print $2 }')
server_pid=$(lsof -i tcp:8080 | awk '$8 == "TCP" { print $2 }' | uniq)
}
# Send a kill signal to the running server