Реализовал уровень 4: Redis-кэш, проверки отказов и индекс истории
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
{
|
||||
"rows": 10000,
|
||||
"query": "SELECT * FROM messages WHERE chat_id=%s AND (created_at,id)>(%s,%s) ORDER BY created_at,id LIMIT 51",
|
||||
"plan": {
|
||||
"Plan": {
|
||||
"Node Type": "Limit",
|
||||
"Parallel Aware": false,
|
||||
"Async Capable": false,
|
||||
"Startup Cost": 0.29,
|
||||
"Total Cost": 12.94,
|
||||
"Plan Rows": 51,
|
||||
"Plan Width": 87,
|
||||
"Actual Startup Time": 0.017,
|
||||
"Actual Total Time": 0.025,
|
||||
"Actual Rows": 51,
|
||||
"Actual Loops": 1,
|
||||
"Shared Hit Blocks": 5,
|
||||
"Shared Read Blocks": 0,
|
||||
"Shared Dirtied Blocks": 0,
|
||||
"Shared Written Blocks": 0,
|
||||
"Local Hit Blocks": 0,
|
||||
"Local Read Blocks": 0,
|
||||
"Local Dirtied Blocks": 0,
|
||||
"Local Written Blocks": 0,
|
||||
"Temp Read Blocks": 0,
|
||||
"Temp Written Blocks": 0,
|
||||
"Plans": [
|
||||
{
|
||||
"Node Type": "Index Scan",
|
||||
"Parent Relationship": "Outer",
|
||||
"Parallel Aware": false,
|
||||
"Async Capable": false,
|
||||
"Scan Direction": "Forward",
|
||||
"Index Name": "messages_history_idx",
|
||||
"Relation Name": "messages",
|
||||
"Alias": "messages",
|
||||
"Startup Cost": 0.29,
|
||||
"Total Cost": 536.25,
|
||||
"Plan Rows": 2160,
|
||||
"Plan Width": 87,
|
||||
"Actual Startup Time": 0.016,
|
||||
"Actual Total Time": 0.021,
|
||||
"Actual Rows": 51,
|
||||
"Actual Loops": 1,
|
||||
"Index Cond": "((chat_id = '44cfe328-842b-43a5-900b-ff083cb13f7f'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.008001+00'::timestamp with time zone, '10e68164-4b26-406f-a3a4-f0395ca68f52'::uuid)))",
|
||||
"Rows Removed by Index Recheck": 0,
|
||||
"Shared Hit Blocks": 5,
|
||||
"Shared Read Blocks": 0,
|
||||
"Shared Dirtied Blocks": 0,
|
||||
"Shared Written Blocks": 0,
|
||||
"Local Hit Blocks": 0,
|
||||
"Local Read Blocks": 0,
|
||||
"Local Dirtied Blocks": 0,
|
||||
"Local Written Blocks": 0,
|
||||
"Temp Read Blocks": 0,
|
||||
"Temp Written Blocks": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
"Planning": {
|
||||
"Shared Hit Blocks": 108,
|
||||
"Shared Read Blocks": 0,
|
||||
"Shared Dirtied Blocks": 0,
|
||||
"Shared Written Blocks": 0,
|
||||
"Local Hit Blocks": 0,
|
||||
"Local Read Blocks": 0,
|
||||
"Local Dirtied Blocks": 0,
|
||||
"Local Written Blocks": 0,
|
||||
"Temp Read Blocks": 0,
|
||||
"Temp Written Blocks": 0
|
||||
},
|
||||
"Planning Time": 0.516,
|
||||
"Triggers": [],
|
||||
"Execution Time": 0.08
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"registration_codes": [
|
||||
201,
|
||||
409,
|
||||
409,
|
||||
409,
|
||||
409,
|
||||
409,
|
||||
409,
|
||||
409
|
||||
],
|
||||
"rollback": "PASS",
|
||||
"profile_cache_ttl_seconds": 59,
|
||||
"redis_fallback": "PASS",
|
||||
"redis_stop_and_request_seconds": 8.617,
|
||||
"db_failure": "503, live=200, recovery with same session",
|
||||
"two_db_error_requests_seconds": 6.05,
|
||||
"expiry_seconds": 2,
|
||||
"expiry": "401",
|
||||
"logout": "401",
|
||||
"passed": true
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
python tests/smoke.py
|
||||
PASS: lab2 public API scenario; infrastructure and grading evidence remain separate.
|
||||
Reference in New Issue
Block a user