Skip to content

Agent Mesh

scale: count the members that stayed, not the ones that were started

Antonio Ojea6bcf83047a9c
diff --git a/tests/scale/member-ladder-summary.py b/tests/scale/member-ladder-summary.py
index 5853b908..c39f3f23 100755
--- a/tests/scale/member-ladder-summary.py
+++ b/tests/scale/member-ladder-summary.py
@@ -98,6 +98,10 @@ for i, minions in enumerate(steps, 1):
break
members = [mem for r in reports for mem in r["members"]]
ready = sorted(mem["ready_ms"] for mem in members if mem.get("ready_ms"))
+ # Resident is what the next step lands on: members that became ready and
+ # whose process is still there, which excludes the ones whose journey
+ # ended in an exit.
+ alive = sum(1 for mem in members if mem.get("ready_ms") and not str(mem.get("error", "")).startswith("process exited"))
journey = sorted(mem["ready_ms"] + mem["first_call_ms"] for mem in members if mem.get("first_call_ms"))
count = sum(r["count"] for r in reports)
completed = sum(r["completed"] for r in reports)
@@ -113,7 +117,8 @@ for i, minions in enumerate(steps, 1):
notes.append(f"step {i}: {n} x {stage}")
for msg, n in sorted(r.get("call_errors", {}).items()):
notes.append(f"step {i}: {n} call attempt(s) failed with: {msg}")
- resident += count
+ resident += alive
+print(f"resident after the last step: {resident}")
for n in notes:
print(n)
diff --git a/tests/scale/member-ladder.sh b/tests/scale/member-ladder.sh
index eb11ee10..c058cae2 100755
--- a/tests/scale/member-ladder.sh
+++ b/tests/scale/member-ladder.sh
@@ -209,9 +209,16 @@ for step in "${STEPS[@]}"; do
# Let the mesh settle on the new population before it is read.
sleep 60
snapshot "step${step_no}-after"
- resident=$target
+ # What the next step lands on is the members that became ready and whose
+ # process is still there, not the number that were started.
+ alive=0
+ for m in "${minions[@]}"; do
+ n=$(python3 -c 'import json,sys; ms=json.load(open(sys.argv[1]))["join"]["members"]; print(sum(1 for m in ms if m.get("ready_ms") and not str(m.get("error","")).startswith("process exited")))' "$OUT/step${step_no}-${m}.json" 2>/dev/null || echo 0)
+ alive=$(( alive + n ))
+ done
+ resident=$(( resident + alive ))
summarize || true
- log "step ${step_no} done: ${resident} members resident"
+ log "step ${step_no} done: ${alive} of ${#minions[@]}x${PER_MINION} resident, ${resident} in all"
done
log "ladder complete: ${resident} members resident; holding until Ctrl-C or ${HOLD}"