@@ -94,10 +94,32 @@ if [[ ${SCALETEST_PARAM_LOAD_SCENARIO_RUN_CONCURRENTLY} == 1 ]]; then
94
94
start_phase " Load scenarios: ${SCALETEST_PARAM_LOAD_SCENARIOS[*]} "
95
95
fi
96
96
97
+ run_scenario_cmd () {
98
+ local scenario=${1}
99
+ shift
100
+ local command=(" $@ " )
101
+
102
+ set +e
103
+ if [[ ${SCALETEST_PARAM_LOAD_SCENARIO_RUN_CONCURRENTLY} == 1 ]]; then
104
+ annotate_grafana scenario " Load scenario: ${scenario} "
105
+ fi
106
+ " ${command[@]} "
107
+ status=${?}
108
+ if [[ ${SCALETEST_PARAM_LOAD_SCENARIO_RUN_CONCURRENTLY} == 1 ]]; then
109
+ export GRAFANA_ADD_TAGS=
110
+ if [[ ${status} != 0 ]]; then
111
+ GRAFANA_ADD_TAGS=error
112
+ fi
113
+ annotate_grafana_end scenario " Load scenario: ${scenario} "
114
+ fi
115
+ exit " ${status} "
116
+ }
117
+
97
118
declare -a pids=()
98
119
declare -A failed=()
99
120
target_start=0
100
121
target_end=-1
122
+
101
123
for scenario in " ${SCALETEST_PARAM_LOAD_SCENARIOS[@]} " ; do
102
124
if [[ ${SCALETEST_PARAM_LOAD_SCENARIO_RUN_CONCURRENTLY} == 0 ]]; then
103
125
start_phase " Load scenario: ${scenario} "
@@ -117,7 +139,7 @@ for scenario in "${SCALETEST_PARAM_LOAD_SCENARIOS[@]}"; do
117
139
target_start=0
118
140
target_end=${target_count}
119
141
fi
120
- coder exp scaletest workspace-traffic \
142
+ run_scenario_cmd " ${scenario} " coder exp scaletest workspace-traffic \
121
143
--template " ${SCALETEST_PARAM_TEMPLATE} " \
122
144
--ssh \
123
145
--bytes-per-tick " ${SCALETEST_PARAM_LOAD_SCENARIO_SSH_TRAFFIC_BYTES_PER_TICK} " \
@@ -153,7 +175,7 @@ for scenario in "${SCALETEST_PARAM_LOAD_SCENARIOS[@]}"; do
153
175
target_start=0
154
176
target_end=${target_count}
155
177
fi
156
- coder exp scaletest workspace-traffic \
178
+ run_scenario_cmd " ${scenario} " coder exp scaletest workspace-traffic \
157
179
--template " ${SCALETEST_PARAM_TEMPLATE} " \
158
180
--bytes-per-tick " ${SCALETEST_PARAM_LOAD_SCENARIO_WEB_TERMINAL_TRAFFIC_BYTES_PER_TICK} " \
159
181
--tick-interval " ${SCALETEST_PARAM_LOAD_SCENARIO_WEB_TERMINAL_TRAFFIC_TICK_INTERVAL} ms" \
@@ -188,7 +210,7 @@ for scenario in "${SCALETEST_PARAM_LOAD_SCENARIOS[@]}"; do
188
210
target_start=0
189
211
target_end=${target_count}
190
212
fi
191
- coder exp scaletest workspace-traffic \
213
+ run_scenario_cmd " ${scenario} " coder exp scaletest workspace-traffic \
192
214
--template " ${SCALETEST_PARAM_TEMPLATE} " \
193
215
--bytes-per-tick " ${SCALETEST_PARAM_LOAD_SCENARIO_APP_TRAFFIC_BYTES_PER_TICK} " \
194
216
--tick-interval " ${SCALETEST_PARAM_LOAD_SCENARIO_APP_TRAFFIC_TICK_INTERVAL} ms" \
@@ -221,7 +243,7 @@ for scenario in "${SCALETEST_PARAM_LOAD_SCENARIOS[@]}"; do
221
243
target_start=0
222
244
target_end=${target_count}
223
245
fi
224
- coder exp scaletest dashboard \
246
+ run_scenario_cmd " ${scenario} " coder exp scaletest dashboard \
225
247
--timeout " ${SCALETEST_PARAM_LOAD_SCENARIO_DASHBOARD_TRAFFIC_DURATION} m" \
226
248
--job-timeout " ${SCALETEST_PARAM_LOAD_SCENARIO_DASHBOARD_TRAFFIC_DURATION} m30s" \
227
249
--output json:" ${SCALETEST_RESULTS_DIR} /traffic-dashboard.json" \
@@ -290,6 +312,10 @@ for scenario in "${SCALETEST_PARAM_LOAD_SCENARIOS[@]}"; do
290
312
fi
291
313
292
314
wait_baseline " ${SCALETEST_PARAM_LOAD_SCENARIO_BASELINE_DURATION} "
315
+ else
316
+ # Stagger the start of each scenario to avoid a burst of load and deted
317
+ # problematic scenarios.
318
+ sleep $(( SCALETEST_PARAM_LOAD_SCENARIO_CONCURRENCY_STAGGERING * 60 ))
293
319
fi
294
320
done
295
321
0 commit comments