-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker_performance_test.sh
executable file
·95 lines (88 loc) · 2.29 KB
/
docker_performance_test.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/env sh
# set -e
runCommand() {
echo
echo "$1"
echo
sleep 3
eval "$1"
echo
}
finish() {
runCommand "curl -v -s -X PUT http://$MOCKSERVER_HOST/mockserver/stop"
}
trap finish INT TERM QUIT EXIT
sleep 5
echo "+++ Create Expectation"
curl -v -s -X PUT http://$MOCKSERVER_HOST/expectation -d '[
{
"httpRequest": {
"path": "/not_simple"
},
"httpResponse": {
"statusCode": 200,
"body": "some not simple response"
},
"times": {
"unlimited": true
}
},
{
"httpRequest": {
"method": "POST",
"path": "/simple"
},
"httpResponse": {
"statusCode": 200,
"body": "some simple POST response"
},
"times": {
"unlimited": true
}
},
{
"httpRequest": {
"path": "/forward"
},
"httpOverrideForwardedRequest": {
"httpRequest": {
"headers": {
"host": [ "127.0.0.1:1080" ]
},
"path": "/simple"
}
},
"times": {
"unlimited": true
}
},
{
"httpRequest": {
"path": "/simple"
},
"httpResponse": {
"statusCode": 200,
"body": "some simple response"
},
"times": {
"unlimited": true
}
}
]'
echo "+++ JVM warm up"
runCommand "locust --loglevel=ERROR --headless --only-summary -u 6000 -r 3 -t 20 --host=http://$MOCKSERVER_HOST"
runCommand "curl -v -k -X PUT http://$MOCKSERVER_HOST/mockserver/reset"
echo "+++ HTTP"
for count in 10 100 200 300 400 500 #600 700 800 900 1000 1100 1200 1250
do
sleep 5
runCommand "locust --loglevel=INFO --headless --only-summary --csv=nonTLS_$count -u $count -r 15 -t 30 --host=http://$MOCKSERVER_HOST"
runCommand "curl -v -k -X PUT http://$MOCKSERVER_HOST/mockserver/reset"
done
echo "+++ HTTPS"
for count in 10 100 200 300 400 500 #600 700 800 900 1000 1100 1200 1250
do
sleep 5
runCommand "locust --loglevel=INFO --headless --only-summary --csv=TLS_$count -u $count -r 15 -t 30 --host=https://$MOCKSERVER_HOST"
runCommand "curl -v -k -X PUT http://$MOCKSERVER_HOST/mockserver/reset"
done