-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathquick_run.sh
More file actions
executable file
·47 lines (40 loc) · 1.25 KB
/
quick_run.sh
File metadata and controls
executable file
·47 lines (40 loc) · 1.25 KB
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
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$ROOT_DIR"
if [[ -n "${LLOG_LOADTEST_PYTHON:-}" ]]; then
REPO_PYTHON="$LLOG_LOADTEST_PYTHON"
elif [[ -x "$ROOT_DIR/.venv-loadtest/bin/python" ]]; then
REPO_PYTHON="$ROOT_DIR/.venv-loadtest/bin/python"
else
REPO_PYTHON="$(command -v python3)"
fi
if [[ -f "$ROOT_DIR/.env" ]]; then
set -a
source "$ROOT_DIR/.env"
set +a
fi
if [[ "${1:-}" == "down" ]]; then
exec "$REPO_PYTHON" -m loadtest.quick_observability down
fi
"$REPO_PYTHON" - <<'PY'
try:
import boto3 # noqa: F401
import oxia # noqa: F401
except Exception as exc:
raise SystemExit(
"quick_run.sh requires a Python with oxia and boto3 installed. "
"Run `python3 -m venv .venv && .venv/bin/python -m pip install -r requirements.txt`. "
f"Current error: {exc!r}"
)
PY
BASE_SCENARIO="${1:-loadtest/run-configs/single-broker-32mib.json}"
if [[ ! -f "$BASE_SCENARIO" ]]; then
echo "missing scenario file: $BASE_SCENARIO" >&2
exit 1
fi
exec "$REPO_PYTHON" -m loadtest.quick_observability run \
--scenario "$BASE_SCENARIO" \
--warmup-seconds "${WARMUP_SECONDS:-15}" \
--duration-seconds "${DURATION_SECONDS:-120}" \
--cooldown-seconds "${COOLDOWN_SECONDS:-15}"