@@ -28,7 +28,7 @@ wait_baseline "${SCALETEST_PARAM_LOAD_SCENARIO_BASELINE_DURATION}"
28
28
29
29
non_greedy_agent_traffic_args=()
30
30
if [[ ${SCALETEST_PARAM_GREEDY_AGENT} != 1 ]]; then
31
- greedy_agent () { : ; }
31
+ greedy_agent_traffic () { : ; }
32
32
else
33
33
echo " WARNING: Greedy agent enabled, this may cause the load tests to fail." >&2
34
34
non_greedy_agent_traffic_args=(
37
37
# --trace=false
38
38
)
39
39
40
+ annotate_grafana greedy_agent " Create greedy agent"
41
+
40
42
coder exp scaletest create-workspaces \
41
43
--count 1 \
42
44
--template " ${SCALETEST_PARAM_GREEDY_AGENT_TEMPLATE} " \
46
48
--no-cleanup \
47
49
--output json:" ${SCALETEST_RESULTS_DIR} /create-workspaces-greedy-agent.json"
48
50
49
- greedy_agent () {
51
+ wait_baseline " ${SCALETEST_PARAM_LOAD_SCENARIO_BASELINE_DURATION} "
52
+
53
+ greedy_agent_traffic () {
50
54
local timeout=${1} scenario=${2}
51
55
# Run the greedy test for ~1/3 of the timeout.
52
56
delay=$(( timeout * 60 / 3 ))
59
63
fi
60
64
61
65
sleep " ${delay} "
62
- annotate_grafana greedy_agent " ${scenario} : Greedy agent"
66
+ annotate_grafana greedy_agent " ${scenario} : Greedy agent traffic "
63
67
64
68
# Produce load at about 1000MB/s (25MB/40ms).
65
69
set +e
80
84
if [[ ${status} != 0 ]]; then
81
85
GRAFANA_ADD_TAGS=error
82
86
fi
83
- annotate_grafana_end greedy_agent " ${scenario} : Greedy agent"
87
+ annotate_grafana_end greedy_agent " ${scenario} : Greedy agent traffic "
84
88
85
89
return ${status}
86
90
}
@@ -94,7 +98,7 @@ for scenario in "${SCALETEST_PARAM_LOAD_SCENARIOS[@]}"; do
94
98
status=0
95
99
case " ${scenario} " in
96
100
" SSH Traffic" )
97
- greedy_agent " ${SCALETEST_PARAM_LOAD_SCENARIO_SSH_TRAFFIC_DURATION} " " ${scenario} " &
101
+ greedy_agent_traffic " ${SCALETEST_PARAM_LOAD_SCENARIO_SSH_TRAFFIC_DURATION} " " ${scenario} " &
98
102
coder exp scaletest workspace-traffic \
99
103
--template " ${SCALETEST_PARAM_TEMPLATE} " \
100
104
--ssh \
@@ -113,7 +117,7 @@ for scenario in "${SCALETEST_PARAM_LOAD_SCENARIOS[@]}"; do
113
117
show_json " ${SCALETEST_RESULTS_DIR} /traffic-ssh.json"
114
118
;;
115
119
" Web Terminal Traffic" )
116
- greedy_agent " ${SCALETEST_PARAM_LOAD_SCENARIO_WEB_TERMINAL_TRAFFIC_DURATION} " " ${scenario} " &
120
+ greedy_agent_traffic " ${SCALETEST_PARAM_LOAD_SCENARIO_WEB_TERMINAL_TRAFFIC_DURATION} " " ${scenario} " &
117
121
coder exp scaletest workspace-traffic \
118
122
--template " ${SCALETEST_PARAM_TEMPLATE} " \
119
123
--bytes-per-tick " ${SCALETEST_PARAM_LOAD_SCENARIO_WEB_TERMINAL_TRAFFIC_BYTES_PER_TICK} " \
@@ -141,8 +145,8 @@ for scenario in "${SCALETEST_PARAM_LOAD_SCENARIOS[@]}"; do
141
145
;;
142
146
143
147
# Debug scenarios, for testing the runner.
144
- " debug:greedy_agent " )
145
- greedy_agent 10 " ${scenario} "
148
+ " debug:greedy_agent_traffic " )
149
+ greedy_agent_traffic 10 " ${scenario} "
146
150
status=$?
147
151
;;
148
152
" debug:success" )
0 commit comments