generated from DTS-STN/next-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
load-test.js
82 lines (77 loc) · 2.93 KB
/
load-test.js
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
// k6 Documentation: https://k6.io/docs/
import { sleep, group } from 'k6'
import http from 'k6/http'
export const options = {
vus: 10,
duration: '5m',
thresholds: {
'http_req_failed': ['rate<0.01'], // http errors should be less than 1%
'http_req_duration': ['p(95)<300'], // 95% of requests should be below 300ms
'group_duration{group:::Next_Template}': ['avg < 200'], // average duration cannot be longer than 200ms
},
}
export default function main() {
let response
group('Next_Template', function () {
response = http.get(
'https://fonts.googleapis.com/css2?family=Lato%3Aital%2Cwght%400%2C100%3B0%2C300%3B0%2C400%3B0%2C700%3B0%2C900%3B1%2C100%3B1%2C300%3B1%2C400%3B1%2C700%3B1%2C900&family=Noto+Sans%3Awght%40400%3B700&display=swap&family=Patua+One%3Awght%40100%3B400%3B700&display=swap&family=Noto+Sans%3Awght%40400%3B700&family=Patua+One%3Awght%40100%3B400%3B700',
{
headers: {
'sec-ch-ua':
'" Not A;Brand";v="99", "Chromium";v="96", "Google Chrome";v="96"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Linux"',
},
}
)
response = http.get(
'https://digital-dojo-engagement-perf.bdm-dev.dts-stn.com/',
{
headers: {
'upgrade-insecure-requests': '1',
'sec-ch-ua':
'" Not A;Brand";v="99", "Chromium";v="96", "Google Chrome";v="96"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Linux"',
},
}
)
response = http.get(
'https://fonts.googleapis.com/css2?family=Lato%3Aital%2Cwght%400%2C100%3B0%2C300%3B0%2C400%3B0%2C700%3B0%2C900%3B1%2C100%3B1%2C300%3B1%2C400%3B1%2C700%3B1%2C900&family=Noto+Sans%3Awght%40400%3B700&display=swap&family=Patua+One%3Awght%40100%3B400%3B700&display=swap&family=Noto+Sans%3Awght%40400%3B700&family=Patua+One%3Awght%40100%3B400%3B700',
{
headers: {
'sec-ch-ua':
'" Not A;Brand";v="99", "Chromium";v="96", "Google Chrome";v="96"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Linux"',
},
}
)
response = http.get(
'https://fonts.gstatic.com/s/lato/v22/S6uyw4BMUTPHjx4wXg.woff2',
{
headers: {
'origin': 'https://digital-dojo-engagement-perf.bdm-dev.dts-stn.com',
'sec-ch-ua':
'" Not A;Brand";v="99", "Chromium";v="96", "Google Chrome";v="96"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Linux"',
},
}
)
response = http.get(
'https://fonts.gstatic.com/s/notosans/v25/o-0IIpQlx3QUlC5A4PNr5TRA.woff2',
{
headers: {
'origin': 'https://digital-dojo-engagement-perf.bdm-dev.dts-stn.com',
'sec-ch-ua':
'" Not A;Brand";v="99", "Chromium";v="96", "Google Chrome";v="96"',
'sec-ch-ua-mobile': '?0',
'sec-ch-ua-platform': '"Linux"',
},
}
)
})
// Automatically added sleep
sleep(1)
}