Skip to content

Commit 11926ce

Browse files
committed
add greedy agent baseline
1 parent 3d7e98e commit 11926ce

File tree

1 file changed

+12
-8
lines changed
  • scaletest/templates/scaletest-runner/scripts

1 file changed

+12
-8
lines changed

scaletest/templates/scaletest-runner/scripts/run.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ wait_baseline "${SCALETEST_PARAM_LOAD_SCENARIO_BASELINE_DURATION}"
2828

2929
non_greedy_agent_traffic_args=()
3030
if [[ ${SCALETEST_PARAM_GREEDY_AGENT} != 1 ]]; then
31-
greedy_agent() { :; }
31+
greedy_agent_traffic() { :; }
3232
else
3333
echo "WARNING: Greedy agent enabled, this may cause the load tests to fail." >&2
3434
non_greedy_agent_traffic_args=(
@@ -37,6 +37,8 @@ else
3737
# --trace=false
3838
)
3939

40+
annotate_grafana greedy_agent "Create greedy agent"
41+
4042
coder exp scaletest create-workspaces \
4143
--count 1 \
4244
--template "${SCALETEST_PARAM_GREEDY_AGENT_TEMPLATE}" \
@@ -46,7 +48,9 @@ else
4648
--no-cleanup \
4749
--output json:"${SCALETEST_RESULTS_DIR}/create-workspaces-greedy-agent.json"
4850

49-
greedy_agent() {
51+
wait_baseline "${SCALETEST_PARAM_LOAD_SCENARIO_BASELINE_DURATION}"
52+
53+
greedy_agent_traffic() {
5054
local timeout=${1} scenario=${2}
5155
# Run the greedy test for ~1/3 of the timeout.
5256
delay=$((timeout * 60 / 3))
@@ -59,7 +63,7 @@ else
5963
fi
6064

6165
sleep "${delay}"
62-
annotate_grafana greedy_agent "${scenario}: Greedy agent"
66+
annotate_grafana greedy_agent "${scenario}: Greedy agent traffic"
6367

6468
# Produce load at about 1000MB/s (25MB/40ms).
6569
set +e
@@ -80,7 +84,7 @@ else
8084
if [[ ${status} != 0 ]]; then
8185
GRAFANA_ADD_TAGS=error
8286
fi
83-
annotate_grafana_end greedy_agent "${scenario}: Greedy agent"
87+
annotate_grafana_end greedy_agent "${scenario}: Greedy agent traffic"
8488

8589
return ${status}
8690
}
@@ -94,7 +98,7 @@ for scenario in "${SCALETEST_PARAM_LOAD_SCENARIOS[@]}"; do
9498
status=0
9599
case "${scenario}" in
96100
"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}" &
98102
coder exp scaletest workspace-traffic \
99103
--template "${SCALETEST_PARAM_TEMPLATE}" \
100104
--ssh \
@@ -113,7 +117,7 @@ for scenario in "${SCALETEST_PARAM_LOAD_SCENARIOS[@]}"; do
113117
show_json "${SCALETEST_RESULTS_DIR}/traffic-ssh.json"
114118
;;
115119
"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}" &
117121
coder exp scaletest workspace-traffic \
118122
--template "${SCALETEST_PARAM_TEMPLATE}" \
119123
--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
141145
;;
142146

143147
# 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}"
146150
status=$?
147151
;;
148152
"debug:success")

0 commit comments

Comments
 (0)