@@ -237,12 +237,22 @@ data "coder_parameter" "load_scenarios" {
237
237
default = jsonencode ([
238
238
" SSH Traffic" ,
239
239
" Web Terminal Traffic" ,
240
+ " App Traffic" ,
240
241
" Dashboard Traffic" ,
241
242
])
242
243
}
243
244
244
- data "coder_parameter" "load_scenario_ssh_traffic_duration " {
245
+ data "coder_parameter" "load_scenario_run_concurrently " {
245
246
order = 23
247
+ name = " Run Load Scenarios Concurrently"
248
+ type = " bool"
249
+ default = false
250
+ description = " Run all load scenarios concurrently, this setting enables the load scenario percentages so that they can be assigned a percentage of 1-100%."
251
+ mutable = true
252
+ }
253
+
254
+ data "coder_parameter" "load_scenario_ssh_traffic_duration" {
255
+ order = 30
246
256
name = " SSH Traffic Duration"
247
257
type = " number"
248
258
description = " The duration of the SSH traffic load scenario in minutes."
@@ -255,7 +265,7 @@ data "coder_parameter" "load_scenario_ssh_traffic_duration" {
255
265
}
256
266
257
267
data "coder_parameter" "load_scenario_ssh_bytes_per_tick" {
258
- order = 24
268
+ order = 31
259
269
name = " SSH Bytes Per Tick"
260
270
type = " number"
261
271
description = " The number of bytes to send per tick in the SSH traffic load scenario."
@@ -267,7 +277,7 @@ data "coder_parameter" "load_scenario_ssh_bytes_per_tick" {
267
277
}
268
278
269
279
data "coder_parameter" "load_scenario_ssh_tick_interval" {
270
- order = 25
280
+ order = 32
271
281
name = " SSH Tick Interval"
272
282
type = " number"
273
283
description = " The number of milliseconds between each tick in the SSH traffic load scenario."
@@ -278,8 +288,21 @@ data "coder_parameter" "load_scenario_ssh_tick_interval" {
278
288
}
279
289
}
280
290
291
+ data "coder_parameter" "load_scenario_ssh_traffic_percentage" {
292
+ order = 33
293
+ name = " SSH Traffic Percentage"
294
+ type = " number"
295
+ description = " The percentage of workspaces that should be targeted for SSH traffic."
296
+ mutable = true
297
+ default = 100
298
+ validation {
299
+ min = 1
300
+ max = 100
301
+ }
302
+ }
303
+
281
304
data "coder_parameter" "load_scenario_web_terminal_traffic_duration" {
282
- order = 26
305
+ order = 40
283
306
name = " Web Terminal Traffic Duration"
284
307
type = " number"
285
308
description = " The duration of the web terminal traffic load scenario in minutes."
@@ -292,7 +315,7 @@ data "coder_parameter" "load_scenario_web_terminal_traffic_duration" {
292
315
}
293
316
294
317
data "coder_parameter" "load_scenario_web_terminal_bytes_per_tick" {
295
- order = 27
318
+ order = 41
296
319
name = " Web Terminal Bytes Per Tick"
297
320
type = " number"
298
321
description = " The number of bytes to send per tick in the web terminal traffic load scenario."
@@ -304,7 +327,7 @@ data "coder_parameter" "load_scenario_web_terminal_bytes_per_tick" {
304
327
}
305
328
306
329
data "coder_parameter" "load_scenario_web_terminal_tick_interval" {
307
- order = 28
330
+ order = 42
308
331
name = " Web Terminal Tick Interval"
309
332
type = " number"
310
333
description = " The number of milliseconds between each tick in the web terminal traffic load scenario."
@@ -315,8 +338,94 @@ data "coder_parameter" "load_scenario_web_terminal_tick_interval" {
315
338
}
316
339
}
317
340
341
+ data "coder_parameter" "load_scenario_web_terminal_traffic_percentage" {
342
+ order = 43
343
+ name = " Web Terminal Traffic Percentage"
344
+ type = " number"
345
+ description = " The percentage of workspaces that should be targeted for web terminal traffic."
346
+ mutable = true
347
+ default = 100
348
+ validation {
349
+ min = 1
350
+ max = 100
351
+ }
352
+ }
353
+
354
+ data "coder_parameter" "load_scenario_app_traffic_duration" {
355
+ order = 50
356
+ name = " App Traffic Duration"
357
+ type = " number"
358
+ description = " The duration of the app traffic load scenario in minutes."
359
+ mutable = true
360
+ default = 30
361
+ validation {
362
+ min = 1
363
+ max = 1440 // 24 hours.
364
+ }
365
+ }
366
+
367
+ data "coder_parameter" "load_scenario_app_bytes_per_tick" {
368
+ order = 51
369
+ name = " App Bytes Per Tick"
370
+ type = " number"
371
+ description = " The number of bytes to send per tick in the app traffic load scenario."
372
+ mutable = true
373
+ default = 1024
374
+ validation {
375
+ min = 1
376
+ }
377
+ }
378
+
379
+ data "coder_parameter" "load_scenario_app_tick_interval" {
380
+ order = 52
381
+ name = " App Tick Interval"
382
+ type = " number"
383
+ description = " The number of milliseconds between each tick in the app traffic load scenario."
384
+ mutable = true
385
+ default = 100
386
+ validation {
387
+ min = 1
388
+ }
389
+ }
390
+
391
+ data "coder_parameter" "load_scenario_app_traffic_percentage" {
392
+ order = 53
393
+ name = " App Traffic Percentage"
394
+ type = " number"
395
+ description = " The percentage of workspaces that should be targeted for app traffic."
396
+ mutable = true
397
+ default = 100
398
+ validation {
399
+ min = 1
400
+ max = 100
401
+ }
402
+ }
403
+
404
+ data "coder_parameter" "load_scenario_app_traffic_mode" {
405
+ order = 54
406
+ name = " App Traffic Mode"
407
+ default = " wsec"
408
+ description = " The mode of the app traffic load scenario."
409
+ mutable = true
410
+ option {
411
+ name = " WebSocket Echo"
412
+ value = " wsec"
413
+ description = " Send traffic to the workspace via the app websocket and read it back."
414
+ }
415
+ option {
416
+ name = " WebSocket Read (Random)"
417
+ value = " wsra"
418
+ description = " Read traffic from the workspace via the app websocket."
419
+ }
420
+ option {
421
+ name = " WebSocket Write (Discard)"
422
+ value = " wsdi"
423
+ description = " Send traffic to the workspace via the app websocket."
424
+ }
425
+ }
426
+
318
427
data "coder_parameter" "load_scenario_dashboard_traffic_duration" {
319
- order = 29
428
+ order = 60
320
429
name = " Dashboard Traffic Duration"
321
430
type = " number"
322
431
description = " The duration of the dashboard traffic load scenario in minutes."
@@ -328,8 +437,21 @@ data "coder_parameter" "load_scenario_dashboard_traffic_duration" {
328
437
}
329
438
}
330
439
440
+ data "coder_parameter" "load_scenario_dashboard_traffic_percentage" {
441
+ order = 61
442
+ name = " Dashboard Traffic Percentage"
443
+ type = " number"
444
+ description = " The percentage of users that should be targeted for dashboard traffic."
445
+ mutable = true
446
+ default = 100
447
+ validation {
448
+ min = 1
449
+ max = 100
450
+ }
451
+ }
452
+
331
453
data "coder_parameter" "load_scenario_baseline_duration" {
332
- order = 26
454
+ order = 100
333
455
name = " Baseline Wait Duration"
334
456
type = " number"
335
457
description = " The duration to wait before starting a load scenario in minutes."
@@ -342,7 +464,7 @@ data "coder_parameter" "load_scenario_baseline_duration" {
342
464
}
343
465
344
466
data "coder_parameter" "greedy_agent" {
345
- order = 30
467
+ order = 200
346
468
type = " bool"
347
469
name = " Greedy Agent"
348
470
default = false
@@ -352,7 +474,7 @@ data "coder_parameter" "greedy_agent" {
352
474
}
353
475
354
476
data "coder_parameter" "greedy_agent_template" {
355
- order = 31
477
+ order = 201
356
478
name = " Greedy Agent Template"
357
479
display_name = " Greedy Agent Template"
358
480
description = " The template used for the greedy agent workspace (must not be same as workspace template)."
@@ -432,6 +554,7 @@ resource "coder_agent" "main" {
432
554
SCALETEST_RUN_ID : local.scaletest_run_id,
433
555
SCALETEST_RUN_DIR : local.scaletest_run_dir,
434
556
SCALETEST_RUN_START_TIME : local.scaletest_run_start_time,
557
+ SCALETEST_PROMETHEUS_START_PORT : " 21112" ,
435
558
436
559
# Comment is a scaletest param, but we want to surface it separately from
437
560
# the rest, so we use a different name.
@@ -443,13 +566,22 @@ resource "coder_agent" "main" {
443
566
SCALETEST_PARAM_CREATE_CONCURRENCY : " ${ data . coder_parameter . create_concurrency . value } " ,
444
567
SCALETEST_PARAM_CLEANUP_STRATEGY : data.coder_parameter.cleanup_strategy.value,
445
568
SCALETEST_PARAM_LOAD_SCENARIOS : data.coder_parameter.load_scenarios.value,
569
+ SCALETEST_PARAM_LOAD_SCENARIO_RUN_CONCURRENTLY : data.coder_parameter.load_scenario_run_concurrently.value ? " 1" : " 0" ,
446
570
SCALETEST_PARAM_LOAD_SCENARIO_SSH_TRAFFIC_DURATION : " ${ data . coder_parameter . load_scenario_ssh_traffic_duration . value } " ,
447
571
SCALETEST_PARAM_LOAD_SCENARIO_SSH_TRAFFIC_BYTES_PER_TICK : " ${ data . coder_parameter . load_scenario_ssh_bytes_per_tick . value } " ,
448
572
SCALETEST_PARAM_LOAD_SCENARIO_SSH_TRAFFIC_TICK_INTERVAL : " ${ data . coder_parameter . load_scenario_ssh_tick_interval . value } " ,
573
+ SCALETEST_PARAM_LOAD_SCENARIO_SSH_TRAFFIC_PERCENTAGE : " ${ data . coder_parameter . load_scenario_ssh_traffic_percentage . value } " ,
449
574
SCALETEST_PARAM_LOAD_SCENARIO_WEB_TERMINAL_TRAFFIC_DURATION : " ${ data . coder_parameter . load_scenario_web_terminal_traffic_duration . value } " ,
450
575
SCALETEST_PARAM_LOAD_SCENARIO_WEB_TERMINAL_TRAFFIC_BYTES_PER_TICK : " ${ data . coder_parameter . load_scenario_web_terminal_bytes_per_tick . value } " ,
451
576
SCALETEST_PARAM_LOAD_SCENARIO_WEB_TERMINAL_TRAFFIC_TICK_INTERVAL : " ${ data . coder_parameter . load_scenario_web_terminal_tick_interval . value } " ,
577
+ SCALETEST_PARAM_LOAD_SCENARIO_WEB_TERMINAL_TRAFFIC_PERCENTAGE : " ${ data . coder_parameter . load_scenario_web_terminal_traffic_percentage . value } " ,
578
+ SCALETEST_PARAM_LOAD_SCENARIO_APP_TRAFFIC_DURATION : " ${ data . coder_parameter . load_scenario_app_traffic_duration . value } " ,
579
+ SCALETEST_PARAM_LOAD_SCENARIO_APP_TRAFFIC_BYTES_PER_TICK : " ${ data . coder_parameter . load_scenario_app_bytes_per_tick . value } " ,
580
+ SCALETEST_PARAM_LOAD_SCENARIO_APP_TRAFFIC_TICK_INTERVAL : " ${ data . coder_parameter . load_scenario_app_tick_interval . value } " ,
581
+ SCALETEST_PARAM_LOAD_SCENARIO_APP_TRAFFIC_PERCENTAGE : " ${ data . coder_parameter . load_scenario_app_traffic_percentage . value } " ,
582
+ SCALETEST_PARAM_LOAD_SCENARIO_APP_TRAFFIC_MODE : data.coder_parameter.load_scenario_app_traffic_mode.value,
452
583
SCALETEST_PARAM_LOAD_SCENARIO_DASHBOARD_TRAFFIC_DURATION : " ${ data . coder_parameter . load_scenario_dashboard_traffic_duration . value } " ,
584
+ SCALETEST_PARAM_LOAD_SCENARIO_DASHBOARD_TRAFFIC_PERCENTAGE : " ${ data . coder_parameter . load_scenario_dashboard_traffic_percentage . value } " ,
453
585
SCALETEST_PARAM_LOAD_SCENARIO_BASELINE_DURATION : " ${ data . coder_parameter . load_scenario_baseline_duration . value } " ,
454
586
SCALETEST_PARAM_GREEDY_AGENT : data.coder_parameter.greedy_agent.value ? " 1" : " 0" ,
455
587
SCALETEST_PARAM_GREEDY_AGENT_TEMPLATE : data.coder_parameter.greedy_agent_template.value,
@@ -709,10 +841,14 @@ resource "kubernetes_pod" "main" {
709
841
name = " home"
710
842
read_only = false
711
843
}
712
- port {
713
- container_port = 21112
714
- name = " prometheus-http"
715
- protocol = " TCP"
844
+ dynamic "port" {
845
+ for_each = data. coder_parameter . load_scenario_run_concurrently . value ? jsondecode (data. coder_parameter . load_scenarios . value ) : [" " ]
846
+ iterator = it
847
+ content {
848
+ container_port = 21112 + it. key
849
+ name = " prom-http${ it . key } "
850
+ protocol = " TCP"
851
+ }
716
852
}
717
853
}
718
854
@@ -787,8 +923,8 @@ resource "kubernetes_manifest" "pod_monitor" {
787
923
}
788
924
}
789
925
podMetricsEndpoints = [
790
- {
791
- port = " prometheus -http"
926
+ for i , _ in data . coder_parameter . load_scenario_run_concurrently . value ? jsondecode (data . coder_parameter . load_scenarios . value ) : [ " " ] : {
927
+ port = " prom -http${ i } "
792
928
interval = " 15s"
793
929
}
794
930
]
0 commit comments