forked from pmuellr/kbn-alert-load
-
Notifications
You must be signed in to change notification settings - Fork 0
/
suites.js
219 lines (194 loc) · 5.18 KB
/
suites.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
'use strict'
/** @typedef { import('./lib/types').Suite } Suite */
/** @typedef { import('./lib/types').Scenario } Scenario */
const AlertInterval = '5s'
const Versions = [
// '7.15.1',
'7.14.2',
'7.13.3',
'7.12.1',
'7.11.2',
// '7.10.2',
// '7.9.3',
// '7.8.1', old api version?
]
const Version = Versions[0]
const AlertsList = [100, 200, 400, 1000, 2000, 4000]
/** @type { Suite[] } */
const suites = module.exports = []
suites.push((suiteIntelVsArm()))
suites.push(...withAlerts(suiteKibanaSizes))
suites.push(...withAlerts(suiteKibanaSizes30Workers))
suites.push(...withAlerts(suiteTmMaxWorkers))
suites.push(...withAlerts(suiteTmPollInterval))
suites.push(...withAlerts(suiteVersions))
suites.push(suiteAlerts())
/** @type { ( fn: (alerts: number) => Suite) => Suite[] } */
function withAlerts(fn) {
return AlertsList.map(alerts => fn(alerts))
}
/** @type { () => Suite } */
function suiteIntelVsArm() {
const templates = [
'aws-general-purpose',
'aws-general-purpose-arm',
// 'aws-cpu-optimized',
// 'aws-cpu-optimized-arm',
]
const kbSpecs = [
'1 x 1 GB',
'1 x 8 GB',
]
/** @type { Scenario[] } */
const scenarios = []
for (const kbSpec of kbSpecs) {
for (const template of templates) {
scenarios.push({
name: `${template} - ${kbSpec}`,
alertInterval: AlertInterval,
alerts: 400,
esSpec: '1 x 64 GB',
kbSpec,
tmMaxWorkers: 30,
tmPollInterval: 3000,
version: Version,
template,
})
}
}
return {
id: `intel-vs-arm`,
description: `vary scenarios by intel vs arm`,
scenarios,
}
}
/** @type { (alerts: number) => Suite } */
function suiteKibanaSizes30Workers(alerts) {
const sizes = [
{ esSpec: '2 x 64 GB', kbSpec: ' 4 x 8 GB' },
{ esSpec: '2 x 64 GB', kbSpec: ' 8 x 8 GB' },
{ esSpec: '2 x 64 GB', kbSpec: '12 x 8 GB' },
{ esSpec: '2 x 64 GB', kbSpec: '16 x 8 GB' },
]
const scenarios = sizes.map((size, index) => ({
name: `kb: ${size.kbSpec}; es: ${size.esSpec}`,
alertInterval: AlertInterval,
alerts,
esSpec: size.esSpec,
kbSpec: size.kbSpec,
tmMaxWorkers: 30,
tmPollInterval: 3000,
version: Version,
}))
return {
id: `deployment-size-${alerts}-30-workers`,
description: `vary scenarios by deployment size for ${alerts} alerts with 30 workers`,
scenarios,
}
}
/** @type { (alerts: number) => Suite } */
function suiteKibanaSizes(alerts) {
const sizes = [
{ esSpec: '4 x 64 GB', kbSpec: ' 4 x 8 GB' },
{ esSpec: '4 x 64 GB', kbSpec: ' 8 x 8 GB' },
{ esSpec: '4 x 64 GB', kbSpec: '12 x 8 GB' },
{ esSpec: '4 x 64 GB', kbSpec: '16 x 8 GB' },
]
const scenarios = sizes.map((size, index) => ({
name: `kb: ${size.kbSpec}; es: ${size.esSpec}`,
alertInterval: AlertInterval,
alerts,
esSpec: size.esSpec,
kbSpec: size.kbSpec,
tmMaxWorkers: 10,
tmPollInterval: 3000,
version: Version,
}))
return {
id: `deployment-size-${alerts}`,
description: `vary scenarios by deployment size for ${alerts} alerts`,
scenarios,
}
}
/** @type { (alerts: number) => Suite } */
function suiteTmMaxWorkers(alerts) {
const tmMaxWorkersList = [ 10, 15, 20 ]
const scenarios = tmMaxWorkersList.map((tmMaxWorkers, index) => {
return {
name: `tm max workers: ${tmMaxWorkers}`,
alertInterval: AlertInterval,
alerts,
esSpec: '1 x 8 GB',
kbSpec: '2 x 8 GB',
tmMaxWorkers,
tmPollInterval: 3000,
version: Version,
}
})
return {
id: `tm-max-workers-${alerts}`,
description: `vary scenarios by TM max workers for ${alerts} alerts`,
scenarios,
}
}
/** @type { (alerts: number) => Suite } */
function suiteTmPollInterval(alerts) {
const tmPollIntervalList = [ 3000, 2000, 1000, 500 ]
const scenarios = tmPollIntervalList.map((tmPollInterval, index) => {
return {
name: `tm poll interval: ${tmPollInterval}`,
alertInterval: AlertInterval,
alerts,
esSpec: '1 x 8 GB',
kbSpec: '2 x 8 GB',
tmMaxWorkers: 10,
tmPollInterval,
version: Version,
}
})
return {
id: `tm-poll-interval-${alerts}`,
description: `vary scenarios by TM poll interval for ${alerts} alerts`,
scenarios,
}
}
/** @type { (alerts: number) => Suite } */
function suiteVersions(alerts) {
const scenarios = Versions.map((version, index) => {
return {
name: `stack version: ${version}`,
alertInterval: AlertInterval,
alerts,
esSpec: '1 x 8 GB',
kbSpec: '2 x 8 GB',
tmMaxWorkers: 10,
tmPollInterval: 3000,
version,
}
})
return {
id: `stack-versions-${alerts}`,
description: `vary scenarios by stack version for ${alerts} alerts`,
scenarios,
}
}
/** @type { () => Suite } */
function suiteAlerts() {
const scenarios = AlertsList.slice(0, 4).map((alerts, index) => {
return {
name: `alerts: ${alerts}`,
alertInterval: AlertInterval,
alerts,
esSpec: '1 x 8 GB',
kbSpec: '2 x 8 GB',
tmMaxWorkers: 10,
tmPollInterval: 3000,
version: Version,
}
})
return {
id: `number-of-alerts`,
description: `vary scenarios by number of alerts`,
scenarios,
}
}