docs: record verified failover and rolling replacement evidence

This commit is contained in:
2026-11-15 19:18:27 +03:00
parent b14fb9a162
commit fa3a69d9b4
4 changed files with 4771 additions and 24 deletions
+19
View File
@@ -95,6 +95,21 @@ async def load(base, token, chat, concurrency, duration):
}
def cpu_counters(env):
ids = compose(env, "ps", "-q", "api").split()
code = (
"import json,pathlib; print(json.dumps({p: "
"pathlib.Path('/sys/fs/cgroup/'+p).read_text() for p in "
"['cpu.stat','memory.current','memory.peak']}))"
)
return {
cid[:12]: json.loads(
command(["docker", "exec", cid, "python", "-c", code], env)
)
for cid in ids
}
def sample(env, stop, output):
while not stop.is_set():
try:
@@ -277,6 +292,7 @@ def main():
)
assert r.status_code == 201
asyncio.run(load(base, token, chat, c, a.warmup))
counters_before = cpu_counters(env)
samples = []
stop = threading.Event()
thread = threading.Thread(target=sample, args=(env, stop, samples))
@@ -286,6 +302,7 @@ def main():
finally:
stop.set()
thread.join()
counters_after = cpu_counters(env)
ids = compose(env, "ps", "-q").split()
inspect = json.loads(command(["docker", "inspect", *ids], env))
result.update(
@@ -298,6 +315,8 @@ def main():
api_memory_mib_each=memory,
dataset_initial_messages=100,
samples=samples,
cgroup_before=counters_before,
cgroup_after=counters_after,
actual_limits=[
{
"role": x["Config"]["Labels"][