# very basic local run, this is meant to be source'ed
set -x
ulimit -n 16384
mkdir -p emptydir
mkdir -p mixerconfig
cp istio/mixer/testdata/config/* mixerconfig/
rm mixerconfig/stackdriver.yaml
cd istio; set +x; source bin/use_bazel_go.sh ; set -x; cd ..
# Need to have go installed and GOPATH/bin in the path
fortio server &
( cd proxy/src/envoy/http/mixer; ./start_envoy > /tmp/envoy.log ) &
./istio/bazel-bin/mixer/cmd/mixs/mixs server --configStoreURL=fs://$(pwd)/mixerconfig --configStoreURL=fs://$(pwd)/emptydir 2> /tmp/mixs.2.log > /tmp/mixs.1.log &
echo "starting everything..."
sleep 3
curl -v http://localhost:9090/debug
sleep 1
curl -v http://localhost:42422/metrics
set +x
echo "you can now run: fortio load -qps 0 -c 16 http://localhost:9090/echo"
