python student-tests/failover_metrics.py
api replicas: ['1c773748bc05', 'aa3dac85e7ed']; load: 4 writers without pauses + 1 reader, client timeout 2 s, retry with the same Idempotency-Key; 3 s before and 10 s after the failure
--- stop 1c773748bc05 ...
    docker stop: 4.56 s; HAProxy excluded it after 1.16 s; errors: 0 {}, last error ended 0.0 s after the failure
    write RPS before 114.7 -> after 65.9; p95 after 125.0 ms, max 250.0 ms; answers from the stopped replica after stop: 0
    confirmed 1006, in history 1006, lost 0, duplicates 0; back in the balancer 4.5 s after docker start
--- kill 1c773748bc05 ...
    docker kill: 0.84 s; HAProxy excluded it after 0.11 s; errors: 1 {'502': 1}, last error ended 0.11 s after the failure
    write RPS before 151.3 -> after 70.3; p95 after 109.0 ms, max 1031.0 ms; answers from the stopped replica after stop: 0
    confirmed 1160, in history 1160, lost 0, duplicates 0; back in the balancer 5.64 s after docker start
--- stop aa3dac85e7ed ...
    docker stop: 4.78 s; HAProxy excluded it after 1.59 s; errors: 0 {}, last error ended 0.0 s after the failure
    write RPS before 104.0 -> after 57.8; p95 after 141.0 ms, max 265.0 ms; answers from the stopped replica after stop: 0
    confirmed 892, in history 892, lost 0, duplicates 0; back in the balancer 3.97 s after docker start
--- kill aa3dac85e7ed ...
    docker kill: 0.94 s; HAProxy excluded it after 0.25 s; errors: 1 {'502': 1}, last error ended 0.14 s after the failure
    write RPS before 155.3 -> after 79.7; p95 after 94.0 ms, max 1094.0 ms; answers from the stopped replica after stop: 0
    confirmed 1266, in history 1266, lost 0, duplicates 0; back in the balancer 4.25 s after docker start

replica       mode  cmd,s  lb_out,s  errors  errors_end,s  rps_before  rps_after  p95_after,ms  rejoin,s
1c773748bc05  stop   4.56      1.16       0           0.0       114.7       65.9         125.0       4.5
1c773748bc05  kill   0.84      0.11       1          0.11       151.3       70.3         109.0      5.64
aa3dac85e7ed  stop   4.78      1.59       0           0.0       104.0       57.8         141.0      3.97
aa3dac85e7ed  kill   0.94      0.25       1          0.14       155.3       79.7          94.0      4.25
PASS: every replica was stopped (stop, kill) and restored; no lost or duplicated messages; saved evidence/failover-metrics.json
