forked from mtusi2026/mtusi2026lab3
Реализовала лабораторную 3 на оценку 4
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
# Результаты проверок лабораторной 3
|
||||
|
||||
Повторная проверка: 2026-10-16. Платформа: Docker Desktop на macOS arm64. Ветка: `solution/BVT2303-Merkulova`.
|
||||
|
||||
## Сборка и контракт
|
||||
|
||||
```text
|
||||
$ go test ./...
|
||||
ok mtusi-messenger/internal/messenger
|
||||
|
||||
$ go vet ./...
|
||||
(ошибок нет)
|
||||
|
||||
$ make check
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
|
||||
$ make test
|
||||
PASS: lab3 public API scenario; infrastructure and grading evidence remain separate.
|
||||
```
|
||||
|
||||
Шесть последовательных запросов через единственный публичный порт Nginx вернули `api-2`, `api-1`, `api-2`, `api-1`, `api-2`, `api-1`.
|
||||
|
||||
## Persistence и официальный failover
|
||||
|
||||
```text
|
||||
$ ACTION_SCRIPT=./scripts/restart.sh make test-persistence
|
||||
PASS: persistence preserved confirmed data and existing session.
|
||||
```
|
||||
|
||||
Официальный failover после исправлений: две реплики наблюдались до отказа, 130 записей успешны, ошибок 0, first recovery 0.734 s. После этого `failover_experiment.py` последовательно остановил `api1` и `api2`, каждый раз восстанавливая предыдущую реплику. `docker compose ps -a` в прежней проверке подтвердил `Exited (0)` у выбранной реплики.
|
||||
|
||||
## Собственные проверки уровня 4
|
||||
|
||||
```text
|
||||
$ python3 student-tests/verify_idempotency.py
|
||||
PASS: 12 parallel requests; instances api-1/api-2; one unique message; conflict=409
|
||||
|
||||
$ python3 student-tests/failover_experiment.py
|
||||
PASS: api-1 5147/0, 643.321 RPS, 0.220 s
|
||||
PASS: api-2 5453/0, 681.546 RPS, 0.237 s
|
||||
|
||||
$ python3 student-tests/rolling_update_experiment.py
|
||||
PASS: 24198 successful, 0 failed, 1572.196 RPS
|
||||
p50=2.246 ms p95=4.140 ms p99=6.926 ms
|
||||
instances=api-1,api-2
|
||||
```
|
||||
|
||||
Сырые безопасные summaries: `idempotency.json`, `failover-grade4.json`, `rolling-update.json`.
|
||||
|
||||
## Сохранённые проверки lab2
|
||||
|
||||
```text
|
||||
$ python3 student-tests/verify_grade4.py
|
||||
PASS: registration race, transaction rollback, bad password and logout
|
||||
|
||||
$ python3 student-tests/verify_expiry.py
|
||||
PASS: two-second Redis session expired and was rejected
|
||||
|
||||
$ python3 student-tests/verify_dependencies.py
|
||||
PASS: Redis/PostgreSQL failures returned 503; anonymous access stayed 401; state recovered
|
||||
```
|
||||
|
||||
## Ресурсные limits
|
||||
|
||||
```text
|
||||
api1 cpu=500000000 memory=201326592
|
||||
api2 cpu=500000000 memory=201326592
|
||||
nginx cpu=250000000 memory=67108864
|
||||
postgres cpu=1000000000 memory=536870912
|
||||
redis cpu=250000000 memory=134217728
|
||||
```
|
||||
|
||||
## SQL-план
|
||||
|
||||
`./scripts/explain_history.sh` создал 10 000 сообщений. PostgreSQL выбрал `Index Scan using messages_chat_history_idx`; execution time данного локального запуска с прогретым cache — 0.028 ms. Полный вывод находится в `explain-history.txt`.
|
||||
Reference in New Issue
Block a user