docs: record verified failover and rolling replacement evidence
This commit is contained in:
@@ -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"][
|
||||
|
||||
Reference in New Issue
Block a user