Зафиксировать чистую проверку и итоговые материалы сдачи
This commit is contained in:
+2
-2
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"passed": true,
|
||||
"candidate_files": 73,
|
||||
"reachable_objects": 85,
|
||||
"candidate_files": 80,
|
||||
"reachable_objects": 109,
|
||||
"required_source_files": {
|
||||
"README.md": "unchanged",
|
||||
"COURSE.md": "unchanged",
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
{
|
||||
"passed": true,
|
||||
"source_commit": "35764f730c90f9797925313875be0a484c13dcff",
|
||||
"source_hashes": {
|
||||
"messenger/app.py": "d54a8c28491eef19026ab53fb18f66f7fa9ebeeaa3ef7f7d43654fb56a960502",
|
||||
"messenger/migrate.py": "eb5cad7ac6abe38dd40b2db307d298b297abe9543b3928c36bab8ef06283664e",
|
||||
"messenger/models.py": "cf44680f8f39228ffc89910577df70354f8d660a6652d62091007cfe074ccbe2",
|
||||
"messenger/__init__.py": "9a72a49106367ca514cc6147d0e727e62c4d33fefd61572d209a5c9494551a2c",
|
||||
"messenger/postgres.py": "8e224cbab14872a54abb23937b7d290975d4209779897aaa551e5cb952cb8365",
|
||||
"messenger/domain.py": "33086cb229083ecee3bcee09f143b4bc09e48896a0c497bd9902e738e2e6b1af",
|
||||
"messenger/config.py": "e4d4aaf674ede8b5abdc361f77c7793ee94d8d7856030c28834eb7c95291b193",
|
||||
"messenger/__main__.py": "ba9a59ad44ee8884cd65cf88d5ea15cbd7051b10f7c729043ddd44ca2f34defe"
|
||||
},
|
||||
"image_id": "sha256:e3f29f12c4f5abd90e7fc25187ec0be0d30836c964ce4661b35d3adf28a316f1",
|
||||
"image_revision": "35764f730c90f9797925313875be0a484c13dcff",
|
||||
"new_secret_set": true,
|
||||
"isolated_project": "vasilev-clean-lab2",
|
||||
"steps": [
|
||||
{
|
||||
"command": "uv sync --locked --python 3.12",
|
||||
"passed": true,
|
||||
"seconds": 0.061
|
||||
},
|
||||
{
|
||||
"command": "make bootstrap",
|
||||
"passed": true,
|
||||
"seconds": 0.03
|
||||
},
|
||||
{
|
||||
"command": "docker compose -f compose.yaml -f compose.test.yaml up -d --build --wait",
|
||||
"passed": true,
|
||||
"seconds": 9.414
|
||||
},
|
||||
{
|
||||
"command": "uv run --locked python research/run.py --output evidence/query-study-final.json",
|
||||
"passed": true,
|
||||
"seconds": 5.001
|
||||
},
|
||||
{
|
||||
"command": "uv run --locked python research/analyze.py evidence/query-study-final.json",
|
||||
"passed": true,
|
||||
"seconds": 0.037
|
||||
},
|
||||
{
|
||||
"command": "make check validate lint PYTHON=.venv/bin/python",
|
||||
"passed": true,
|
||||
"seconds": 1.373
|
||||
},
|
||||
{
|
||||
"command": "make test PUBLIC_PORT=18092",
|
||||
"passed": true,
|
||||
"seconds": 0.608
|
||||
},
|
||||
{
|
||||
"command": "make test-student PUBLIC_PORT=18092",
|
||||
"passed": true,
|
||||
"seconds": 19.274
|
||||
},
|
||||
{
|
||||
"command": "python3 scripts/verify_lifecycle.py --base-url http://127.0.0.1:18092 --short-url http://127.0.0.1:28092 --output evidence/lifecycle-clean.json",
|
||||
"passed": true,
|
||||
"seconds": 15.829
|
||||
},
|
||||
{
|
||||
"command": "python3 scripts/verify_pool.py --output evidence/pool-clean.json",
|
||||
"passed": true,
|
||||
"seconds": 3.052
|
||||
}
|
||||
],
|
||||
"runtime_unchanged_after_tested_source": true
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
{
|
||||
"date_utc": "2026-10-30T14:32:25.833684+00:00",
|
||||
"passed": true,
|
||||
"public_persistence": "Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.\nPASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.",
|
||||
"before": {
|
||||
"api": {
|
||||
"cid": "feedf7c348932793dda9b1f24db94c9af73053d95cf49608b62be69768a486c2",
|
||||
"pid": 29220,
|
||||
"started_at": "2026-10-30T14:31:53.619517906Z"
|
||||
},
|
||||
"cache": {
|
||||
"cid": "abf39e834915df8c38729bbef9e990551831e925a59824ef13e0b07a608724c5",
|
||||
"pid": 28778,
|
||||
"started_at": "2026-10-30T14:31:50.484820839Z"
|
||||
},
|
||||
"postgres": {
|
||||
"cid": "ef3c2a78d4db5f93e3c2b79aad28e972460127231b6e39ae6120a4d9acf7c8c0",
|
||||
"pid": 28777,
|
||||
"started_at": "2026-10-30T14:31:50.485089224Z"
|
||||
}
|
||||
},
|
||||
"after": {
|
||||
"api": {
|
||||
"cid": "feedf7c348932793dda9b1f24db94c9af73053d95cf49608b62be69768a486c2",
|
||||
"pid": 32006,
|
||||
"started_at": "2026-10-30T14:32:27.197264989Z"
|
||||
},
|
||||
"cache": {
|
||||
"cid": "abf39e834915df8c38729bbef9e990551831e925a59824ef13e0b07a608724c5",
|
||||
"pid": 31862,
|
||||
"started_at": "2026-10-30T14:32:27.001543385Z"
|
||||
},
|
||||
"postgres": {
|
||||
"cid": "ef3c2a78d4db5f93e3c2b79aad28e972460127231b6e39ae6120a4d9acf7c8c0",
|
||||
"pid": 31777,
|
||||
"started_at": "2026-10-30T14:32:26.935843635Z"
|
||||
}
|
||||
},
|
||||
"same_token_and_message_after_restart": true,
|
||||
"cache_flush_repopulates": true,
|
||||
"cache_failure": {
|
||||
"authenticated_status": 200,
|
||||
"anonymous_status": 401,
|
||||
"seconds": 0.0051
|
||||
},
|
||||
"database_failure": {
|
||||
"cached_actor_status": 503,
|
||||
"ready_status": 503,
|
||||
"live_status": 200,
|
||||
"seconds": 2.0111
|
||||
},
|
||||
"session_after_database_recovery": true,
|
||||
"failed_chat_transaction_left_rows": 0,
|
||||
"migrations_reapplied_twice": true,
|
||||
"expiry": {
|
||||
"configured_ttl_seconds": 2,
|
||||
"observed_after_seconds": 2.4192,
|
||||
"expired_status": 401,
|
||||
"short_api_restarted_before_check": true
|
||||
},
|
||||
"logout_with_cached_user": 401,
|
||||
"credentials_absent_from_api_logs": true
|
||||
}
|
||||
@@ -0,0 +1,212 @@
|
||||
{
|
||||
"passed": true,
|
||||
"clients": 50,
|
||||
"max_pool_size": 8,
|
||||
"max_waiting": 32,
|
||||
"admitted": 8,
|
||||
"rejected_503": 42,
|
||||
"max_seconds": 2.225532210955862,
|
||||
"rows": [
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0021635820157826
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 1.4174031093716621e-05
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0020112140337005
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 4.960980731993914e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0019857849692926
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 1.729995710775256e-05
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0002509180339985
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.002100343001075
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0020874189794995
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0020374360028654
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 1.0297051630914211e-05
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"seconds": 2.2069947799900547
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"seconds": 2.2116657389560714
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"seconds": 2.218611836025957
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"seconds": 2.211599581001792
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"seconds": 2.2174383330275305
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 3.5440316423773766e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.002133609028533
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0019869100069627
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0020533190108836
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.002086877997499
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.002052652009297
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0019422639743425
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.002054319018498
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0019010339747183
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0022103139781393
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0021815079962835
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0008202450117096
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.002282141998876
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0022370780352503
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0022053119610064
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0022150659933686
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0022375360131264
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.0022462070337497
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.046796726062894e-05
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 1.2798001989722252e-05
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.002062240964733
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"seconds": 2.222286756034009
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"seconds": 2.225532210955862
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 7.503957021981478e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 8.045986760407686e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 3.0440278351306915e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 7.921014912426472e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 5.376990884542465e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.7510104700922966e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 7.003021892160177e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 7.421011105179787e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 3.0850060284137726e-06
|
||||
},
|
||||
{
|
||||
"status": 503,
|
||||
"seconds": 2.6259804144501686e-06
|
||||
},
|
||||
{
|
||||
"status": 200,
|
||||
"seconds": 2.2048024350078776
|
||||
}
|
||||
],
|
||||
"date_utc": "2026-10-30T14:32:44.301114+00:00"
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
# Итог исследования ЛР2: план запроса и восстановление
|
||||
|
||||
Источник: [неизменённые raw-данные](query-study-final.json).
|
||||
Измерено из чистого clone `35764f730c90f9797925313875be0a484c13dcff`, рабочий каталог в начале опыта чистый.
|
||||
|
||||
| Метрика | Индекс chat_id | Индекс (chat_id,created_at,id) |
|
||||
|---|---:|---:|
|
||||
| Медиана SQL, мс | 3.215 | 0.013 |
|
||||
| Размер индекса, bytes | 720,896 | 5,914,624 |
|
||||
| Медиана INSERT 5000 + COMMIT, с | 0.06902 | 0.03764 |
|
||||
| Медиана прироста WAL для 5000 записей, bytes | 1,408,792 | 1,776,184 |
|
||||
|
||||
На выбранной глубокой странице составной индекс сокращает SQL-время примерно
|
||||
в 247.3 раза, ценой большего индекса
|
||||
и WAL в этой серии. Это сравнение прогретого SQL, а не HTTP API.
|
||||
Более короткое время вставки в трёх опытах не доказывает общего ускорения записи:
|
||||
кэш, checkpoint, порядок измерений и короткая длительность влияют на результат.
|
||||
|
||||
Backup `pg_dump -Fc`: 3,003,381 bytes, 0.248 с.
|
||||
Restore `pg_restore` в новую БД: 0.401 с.
|
||||
Совпали количества всех пяти таблиц, 20 выбранных полных сообщений и checksum
|
||||
всех 100 000 сообщений. Обе созданные исследовательские БД удалены.
|
||||
|
||||
Backup — снимок; изменения после него не входят в восстановление. Без WAL-архивации
|
||||
и PITR нельзя обещать нулевую потерю данных. Время не включает доставку backup,
|
||||
замену сервера и переключение клиентов. Подробная [методика](../research/README.md).
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,34 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="900" height="610" viewBox="0 0 900 610">
|
||||
<rect width="900" height="610" fill="white"/>
|
||||
<g font-family="sans-serif" font-size="15" fill="#172033">
|
||||
<text x="30" y="30" font-size="21">100 000 messages: warm PostgreSQL comparison</text>
|
||||
<text x="30" y="65">SQL median, ms</text>
|
||||
<text x="30" y="99">chat_only</text>
|
||||
<rect x="140" y="80" width="530.00" height="24" fill="#d68439"/>
|
||||
<text x="680.00" y="98">3.215</text>
|
||||
<text x="30" y="132">composite</text>
|
||||
<rect x="140" y="113" width="2.14" height="24" fill="#346dc4"/>
|
||||
<text x="152.14" y="131">0.013</text>
|
||||
<text x="30" y="195">INSERT 5000 + COMMIT, s</text>
|
||||
<text x="30" y="229">chat_only</text>
|
||||
<rect x="140" y="210" width="530.00" height="24" fill="#d68439"/>
|
||||
<text x="680.00" y="228">0.0690227</text>
|
||||
<text x="30" y="262">composite</text>
|
||||
<rect x="140" y="243" width="289.04" height="24" fill="#346dc4"/>
|
||||
<text x="439.04" y="261">0.0376425</text>
|
||||
<text x="30" y="325">Index size, bytes</text>
|
||||
<text x="30" y="359">chat_only</text>
|
||||
<rect x="140" y="340" width="64.60" height="24" fill="#d68439"/>
|
||||
<text x="214.60" y="358">720896</text>
|
||||
<text x="30" y="392">composite</text>
|
||||
<rect x="140" y="373" width="530.00" height="24" fill="#346dc4"/>
|
||||
<text x="680.00" y="391">5.91462e+06</text>
|
||||
<text x="30" y="455">WAL for INSERT 5000, bytes</text>
|
||||
<text x="30" y="489">chat_only</text>
|
||||
<rect x="140" y="470" width="420.37" height="24" fill="#d68439"/>
|
||||
<text x="570.37" y="488">1.40879e+06</text>
|
||||
<text x="30" y="522">composite</text>
|
||||
<rect x="140" y="503" width="530.00" height="24" fill="#346dc4"/>
|
||||
<text x="680.00" y="521">1.77618e+06</text>
|
||||
<text x="30" y="595">3 phases/index; 7 reads/phase; same data and limits. SQL time is not HTTP time.</text>
|
||||
</g></svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
Reference in New Issue
Block a user