blob: 317202a6abdf86ae7fa4a7dbcb08c361c387aacb [file] [log] [blame]
Craig Tillere4860192015-02-23 17:10:41 -08001#!/bin/sh
2
3# performs a single qps run with one client and one server
4
5set -ex
6
7cd $(dirname $0)/../../..
8
Craig Tiller2d0f36c2015-02-23 23:16:17 -08009killall qps_server qps_client || true
10
11config=opt
12
Craig Tillere4860192015-02-23 17:10:41 -080013NUMCPUS=`python2.7 -c 'import multiprocessing; print multiprocessing.cpu_count()'`
14
Craig Tiller2d0f36c2015-02-23 23:16:17 -080015make CONFIG=$config qps_client qps_server qps_driver -j$NUMCPUS
Craig Tillere4860192015-02-23 17:10:41 -080016
Craig Tiller2d0f36c2015-02-23 23:16:17 -080017bins/$config/qps_server -driver_port 10000 -port 10002 &
Craig Tillere4860192015-02-23 17:10:41 -080018SERVER_PID=$!
Craig Tiller2d0f36c2015-02-23 23:16:17 -080019bins/$config/qps_client -driver_port 10001 &
Craig Tillere4860192015-02-23 17:10:41 -080020CLIENT_PID=$!
21
Craig Tiller4f7a1ff2015-02-23 17:16:56 -080022# wait for startup
23sleep 2
24
Craig Tiller4ef7a292015-02-23 17:29:01 -080025export QPS_SERVERS=localhost:10000
26export QPS_CLIENTS=localhost:10001
Craig Tillere4860192015-02-23 17:10:41 -080027
Craig Tiller2d0f36c2015-02-23 23:16:17 -080028bins/$config/qps_driver $*
Craig Tillere4860192015-02-23 17:10:41 -080029
30kill -2 $CLIENT_PID
31kill -2 $SERVER_PID
32wait
33