-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor benchmark and timer scripts
- Loading branch information
1 parent
2f7e0dc
commit 497be0b
Showing
4 changed files
with
92 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/bin/bash -eux | ||
|
||
if [ "$#" -ne 1 ]; then | ||
echo "Usage: $0 <type> <prefix> <client>" | ||
exit 1 | ||
fi | ||
|
||
PREFIX=$1 | ||
CLIENT=$2 | ||
|
||
# TYPE=base | ||
# TYPE=base+picop | ||
# TYPE=base+gw+istio | ||
# TYPE=base+gw+picop | ||
|
||
DURATION=10 | ||
RPS=1000 | ||
|
||
TIMESTAMP=$(date +%s) | ||
NAME="data/$PREFIX/$TYPE/$CLIENT-$RPS-$DURATION/$TIMESTAMP" | ||
|
||
if [ "$TYPE" = "base" ]; then | ||
URL="http://service-istio.service-istio.svc.cluster.local:32001" | ||
OPTION="" | ||
elif [ "$TYPE" = "base+picop" ]; then | ||
URL="http://service-istio.service-istio.svc.cluster.local:31002" | ||
OPTION="--picop" | ||
elif [ "$TYPE" = "base+gw+istio" ]; then | ||
URL="http://service-istio.service-istio.svc.cluster.local:30001" | ||
OPTION="" | ||
elif [ "$TYPE" = "base+gw+picop" ]; then | ||
URL="hhttp://proxy-both.service.svc.cluster.local:30002" | ||
OPTION="--picop" | ||
else | ||
echo "Invalid type: $TYPE" | ||
exit 1 | ||
fi | ||
|
||
CMD="/usr/local/go/bin/go run timertt/main.go --url $URL --prefix $NAME --env-id main --req-per-sec $RPS --duration $DURATION --client-num $CLIENT --payload 1000 $OPTION" | ||
|
||
echo "NAME: $NAME" | ||
echo "CMD: $CMD" | ||
echo "TIMESTAMP: $TIMESTAMP" | ||
|
||
cleanup() { | ||
echo "SIGINT received, cleaning up..." | ||
ssh onoe-benchmark-1 "pkill -2 --echo 'go'" | ||
|
||
kill $(jobs -p) | ||
exit 1 | ||
} | ||
|
||
trap 'cleanup' SIGINT | ||
|
||
ssh onoe-benchmark-1 "cd benchmark/consumption && $CMD" | ||
|
||
mkdir -p ./data/$PREFIX/$TYPE/$CLIENT-$RPS-$DURATION | ||
scp onoe-benchmark-1:benchmark/consumption/$NAME.csv ./$NAME.csv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash -ux | ||
|
||
cd kubernetes/manifests | ||
|
||
kubectl delete -f namespace.yaml | ||
kubectl apply -f namespace.yaml | ||
kubectl apply -f proxy-http.yaml | ||
kubectl apply -f proxy-both.yaml | ||
./script/create-service.sh http main | kubectl -n service apply -f - | ||
./script/create-service.sh http feature-1 | kubectl -n service apply -f - | ||
./script/create-service.sh http main | kubectl -n service-istio apply -f - | ||
./script/create-service.sh http feature-1 | kubectl -n service-istio apply -f - | ||
|
||
cd ../../istio | ||
kubectl delete -f namespace.yaml | ||
kubectl apply -f namespace.yaml | ||
kubectl apply -f gateway.yaml | ||
kubectl apply -f vs.yaml | ||
kubectl apply -f ingressgateway-svc.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters