forked from mtusi2026/mtusi2026lab4
Лаба 4: вложения в S3, уровни 3-5, reconciler (трек 2)
This commit is contained in:
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
# Базовая нагрузка, затем по очереди отказ каждой API-реплики под нагрузкой с восстановлением между ними.
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
COMPOSE="docker compose --env-file .env"
|
||||
|
||||
wait_healthy() {
|
||||
i=0
|
||||
while [ "$i" -lt 90 ]; do
|
||||
c=$($COMPOSE ps api --format '{{.Health}}' | grep -c '^healthy$' || true)
|
||||
[ "$c" -ge 2 ] && return 0
|
||||
i=$((i + 1)); sleep 1
|
||||
done
|
||||
echo "replicas did not become healthy" >&2; return 1
|
||||
}
|
||||
|
||||
python3 student_tests/loadgen.py --duration 30 --output evidence/load-baseline.json
|
||||
for idx in 0 1; do
|
||||
python3 student_tests/loadgen.py --duration 40 --action-script scripts/stop-one.sh \
|
||||
--action-at 10 --target-index "$idx" --output "evidence/load-stop-$idx.json"
|
||||
$COMPOSE ps -a > "evidence/load-stop-$idx-ps.txt"
|
||||
$COMPOSE start api
|
||||
wait_healthy
|
||||
sleep 10 # LB возвращает реплику после 2 успешных проверок
|
||||
done
|
||||
Reference in New Issue
Block a user