-
Notifications
You must be signed in to change notification settings - Fork 0
/
benchmark.sh
executable file
·61 lines (51 loc) · 1.94 KB
/
benchmark.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/sh
if [ "$#" -ne 2 ]; then
echo "Error: This script requires exactly 2 arguments."
echo "Usage: ./benchmark.sh TARGET_APP AWS_REGION"
echo "TARGET_APP in ['plain-java', 'serverless-java-container', 'spring', 'micronaut', 'quarkus'"
echo "Example: ./benchmark.sh plain-java eu-west-1"
exit 1
fi
APP=$1
AWS_REGION=$2
STACK_NAME="workshop-java-lambda-optimizations"
API_GW_URL=$(aws cloudformation describe-stacks --stack-name $STACK_NAME --query "Stacks[0].Outputs[?OutputKey=='WorkshopApiUrl'].OutputValue" --region $AWS_REGION --output text)
if [ $APP == "plain-java" ]; then
echo "Running Artillery on plain-java-request-handler"
artillery run -t $API_GW_URL loadtest/plain-java-request-handler.yaml
sleep 30
echo "End of Artillery on plain-java-request-handler"
exit 0
fi
if [ $APP == "serverless-java-container" ]; then
echo "Running Artillery on serverless-java-container"
artillery run -t $API_GW_URL loadtest/serverless-java-container.yaml
sleep 30
echo "End of Artillery on serverless-java-container"
exit 0
fi
if [ $APP == "spring" ]; then
echo "Running Artillery on springboot-function-handler"
artillery run -t $API_GW_URL loadtest/springboot-function-handler.yaml
sleep 30
echo "End of Artillery on springboot-function-handler"
exit 0
fi
if [ $APP == "micronaut" ]; then
echo "Running Artillery on micronaut-request-handler"
artillery run -t $API_GW_URL loadtest/micronaut-request-handler.yaml
sleep 30
echo "End of Artillery on micronaut-request-handler"
exit 0
fi
if [ $APP == "quarkus" ]; then
echo "Running Artillery on micronaut-request-handler"
artillery run -t $API_GW_URL loadtest/quarkus-request-handler.yaml
sleep 30
echo "End of Artillery on quarkus-request-handler"
exit 0
fi
echo "Usage: ./benchmark.sh TARGET_APP AWS_REGION"
echo "TARGET_APP in ['plain-java', 'serverless-java-container', 'spring', 'micronaut', 'quarkus'"
echo "Example: ./benchmark.sh plain-java eu-west-1"
exit 1