-
Notifications
You must be signed in to change notification settings - Fork 2
/
standalone_performance_test_memory_size.sh
executable file
·85 lines (79 loc) · 2.26 KB
/
standalone_performance_test_memory_size.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
#!/usr/bin/env bash
# ./standalone_performance_test_memory_size.sh 2>&1 > standalone_performance_test_memory_size.log
export JAVA_HOME=`/usr/libexec/java_home -v 13`
ulimit -S -n 49152
curl -v -k -X PUT http://localhost:1080/mockserver/stop || true
sleep 2
export TYPE=memory
for outterLoop in 100 200 500 1000 2000 4000
do
java -Xmx${outterLoop}m -Dmockserver.logLevel=WARN \
-Dmockserver.disableSystemOut=true \
-jar ~/.m2/repository/org/mock-server/mockserver-netty/5.11.1-SNAPSHOT/mockserver-netty-5.11.1-SNAPSHOT-jar-with-dependencies.jar \
-serverPort 1080 &
sleep 5
echo "+++ Create Expectation"
curl -v -s -X PUT http://127.0.0.1:1080/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
}
}
]'
for count in 500 1000 2000
do
export NAME=${outterLoop}_${count}_${TYPE}
locust --loglevel=DEBUG --headless --only-summary --csv="${NAME}" -u $count -r 15 -t 120 --host=http://127.0.0.1:1080 2>&1
curl -v -k -X PUT http://localhost:1080/mockserver/reset
done
curl -v -k -X PUT http://localhost:1080/mockserver/stop || true
sleep 20
done