forked from mtusi2026/mtusi2026lab2
test: add resilience and benchmark verification
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
backup_format=PostgreSQL custom
|
||||
restore_database=messenger_restore
|
||||
users=35
|
||||
chats=9
|
||||
chat_members=17
|
||||
messages=8
|
||||
message_sample_digest_match=true
|
||||
recovery_seconds=1
|
||||
rpo=backup snapshot; commits after pg_dump snapshot are outside the restore point
|
||||
@@ -0,0 +1,234 @@
|
||||
{
|
||||
"generated_at": "2026-09-24T06:31:48Z",
|
||||
"go_version": "go1.26.5",
|
||||
"platform": "linux/arm64",
|
||||
"cpus": 2,
|
||||
"messages": 100000,
|
||||
"chat_distribution": [
|
||||
60000,
|
||||
20000,
|
||||
10000,
|
||||
588,
|
||||
588,
|
||||
588,
|
||||
588,
|
||||
588,
|
||||
588,
|
||||
588,
|
||||
588,
|
||||
588,
|
||||
588,
|
||||
588,
|
||||
588,
|
||||
588,
|
||||
588,
|
||||
588,
|
||||
588,
|
||||
592
|
||||
],
|
||||
"seed_duration_seconds": 0.297102214,
|
||||
"plans": [
|
||||
{
|
||||
"name": "history_composite",
|
||||
"ddl": "CREATE INDEX experiment_history_idx ON lab2_experiment.messages (chat_id, created_at, id)",
|
||||
"plan": [
|
||||
{
|
||||
"Plan": {
|
||||
"Node Type": "Limit",
|
||||
"Parallel Aware": false,
|
||||
"Async Capable": false,
|
||||
"Startup Cost": 0.42,
|
||||
"Total Cost": 271.86,
|
||||
"Plan Rows": 100,
|
||||
"Plan Width": 315,
|
||||
"Actual Startup Time": 0.020,
|
||||
"Actual Total Time": 0.042,
|
||||
"Actual Rows": 100,
|
||||
"Actual Loops": 1,
|
||||
"Shared Hit Blocks": 6,
|
||||
"Shared Read Blocks": 4,
|
||||
"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": "experiment_history_idx",
|
||||
"Relation Name": "messages",
|
||||
"Alias": "messages",
|
||||
"Startup Cost": 0.42,
|
||||
"Total Cost": 1411.91,
|
||||
"Plan Rows": 520,
|
||||
"Plan Width": 315,
|
||||
"Actual Startup Time": 0.019,
|
||||
"Actual Total Time": 0.037,
|
||||
"Actual Rows": 100,
|
||||
"Actual Loops": 1,
|
||||
"Index Cond": "((chat_id = '62ec06f6-c3c9-5e9b-a213-28604e4f69cd'::uuid) AND (ROW(created_at, id) \u003e ROW('2026-01-01 00:00:00.005939+00'::timestamp with time zone, 'd160edac-1f4b-57f8-a01f-cbbfd7250741'::uuid)))",
|
||||
"Rows Removed by Index Recheck": 0,
|
||||
"Shared Hit Blocks": 6,
|
||||
"Shared Read Blocks": 4,
|
||||
"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": 51,
|
||||
"Shared Read Blocks": 1,
|
||||
"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.222,
|
||||
"Triggers": [],
|
||||
"Execution Time": 0.069
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "global_time",
|
||||
"ddl": "CREATE INDEX experiment_history_idx ON lab2_experiment.messages (created_at, id)",
|
||||
"plan": [
|
||||
{
|
||||
"Plan": {
|
||||
"Node Type": "Limit",
|
||||
"Parallel Aware": false,
|
||||
"Async Capable": false,
|
||||
"Startup Cost": 0.42,
|
||||
"Total Cost": 3533.04,
|
||||
"Plan Rows": 100,
|
||||
"Plan Width": 315,
|
||||
"Actual Startup Time": 0.055,
|
||||
"Actual Total Time": 0.584,
|
||||
"Actual Rows": 100,
|
||||
"Actual Loops": 1,
|
||||
"Shared Hit Blocks": 1994,
|
||||
"Shared Read Blocks": 19,
|
||||
"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": "experiment_history_idx",
|
||||
"Relation Name": "messages",
|
||||
"Alias": "messages",
|
||||
"Startup Cost": 0.42,
|
||||
"Total Cost": 20524.95,
|
||||
"Plan Rows": 581,
|
||||
"Plan Width": 315,
|
||||
"Actual Startup Time": 0.054,
|
||||
"Actual Total Time": 0.578,
|
||||
"Actual Rows": 100,
|
||||
"Actual Loops": 1,
|
||||
"Index Cond": "(ROW(created_at, id) \u003e ROW('2026-01-01 00:00:00.005939+00'::timestamp with time zone, 'd160edac-1f4b-57f8-a01f-cbbfd7250741'::uuid))",
|
||||
"Rows Removed by Index Recheck": 0,
|
||||
"Filter": "(chat_id = '62ec06f6-c3c9-5e9b-a213-28604e4f69cd'::uuid)",
|
||||
"Rows Removed by Filter": 1900,
|
||||
"Shared Hit Blocks": 1994,
|
||||
"Shared Read Blocks": 19,
|
||||
"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": 33,
|
||||
"Shared Read Blocks": 1,
|
||||
"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.161,
|
||||
"Triggers": [],
|
||||
"Execution Time": 0.597
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"writes": [
|
||||
{
|
||||
"name": "no_secondary_index",
|
||||
"rows": 10000,
|
||||
"samples_seconds": [
|
||||
0.029270334,
|
||||
0.031755962,
|
||||
0.032344456,
|
||||
0.032778799,
|
||||
0.033289467
|
||||
],
|
||||
"median_seconds": 0.032344456,
|
||||
"rows_per_second": 309171.9953490638,
|
||||
"index_bytes": 0
|
||||
},
|
||||
{
|
||||
"name": "history_composite",
|
||||
"rows": 10000,
|
||||
"samples_seconds": [
|
||||
0.032376473,
|
||||
0.032606465,
|
||||
0.03496374,
|
||||
0.039391471,
|
||||
0.05066359
|
||||
],
|
||||
"median_seconds": 0.03496374,
|
||||
"rows_per_second": 286010.5926883108,
|
||||
"index_bytes": 991232
|
||||
},
|
||||
{
|
||||
"name": "global_time",
|
||||
"rows": 10000,
|
||||
"samples_seconds": [
|
||||
0.030691535,
|
||||
0.032534157,
|
||||
0.035047577,
|
||||
0.035801915,
|
||||
0.043506137
|
||||
],
|
||||
"median_seconds": 0.035047577,
|
||||
"rows_per_second": 285326.4292707025,
|
||||
"index_bytes": 425984
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
date=2026-09-24
|
||||
environment=linux/arm64 containers, API limit 2 CPU and 512 MiB
|
||||
make_check=PASS
|
||||
openapi_validation=PASS
|
||||
golangci_lint_2.13.2=0 issues
|
||||
go_test_race_all=PASS
|
||||
go_vet_all=PASS
|
||||
go_build_messenger=PASS
|
||||
compose_config=PASS
|
||||
public_smoke=PASS: lab2 public API scenario
|
||||
postgres_valkey_integration=PASS
|
||||
dependency_outage=PASS: PostgreSQL and Valkey outage recovery
|
||||
persistence=PASS: confirmed data and existing session preserved
|
||||
migrations=PASS: repeated API restarts reused schema migration checksum without duplicate data
|
||||
Reference in New Issue
Block a user