feat(memlab): idle gap to separate per-request from per-second growth

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
This commit is contained in:
Martin Vogel committed 2026-07-25 23:16:46 +02:00
1 parent 7cefb5e036
commit 026b5ed70e
2 files changed
+11 -1

No files matched your search

+10
View File
@@ -11,6 +11,7 @@ import argparse
import json
import subprocess
import sys
import time
def rpc(proc, payload, timeout_note):
@@ -39,6 +40,8 @@ def main():
parser.add_argument("--stderr", help="file for the server's stderr; never discard it")
parser.add_argument("--tool", default="search_graph",
help="tool to repeat; varying it isolates which path leaks")
parser.add_argument("--idle-seconds", type=float, default=0.0,
help="pause midway; separates per-request growth from per-second growth")
parser.add_argument("--skip-index", action="store_true",
help="omit the initial index, to separate store setup from the loop")
args = parser.parse_args()
@@ -69,7 +72,14 @@ def main():
print(f"index failed: {indexed['error']}", file=sys.stderr)
return 3
halfway = 2 + args.requests // 2
for i in range(2, args.requests + 2):
if args.idle_seconds > 0 and i == halfway:
# Nothing is requested during this gap. Any commit growth across
# it belongs to a background thread, not the request path.
print(f"idle-start id={i}", flush=True)
time.sleep(args.idle_seconds)
print(f"idle-end id={i}", flush=True)
arguments = {"search_graph": {"name_pattern": ".*Widget.*", "limit": 10},
"list_projects": {},
"get_graph_schema": {},
+1 -1
View File
@@ -112,7 +112,7 @@ if command -v cygpath >/dev/null 2>&1 && ! command -v winepath >/dev/null 2>&1;
DRIVE_CORPUS="$(cygpath -w "$CORPUS")"
DRIVE_STDERR="$(cygpath -w "$WORK/server-stderr.log")"
fi
python3 "$(dirname "$0")/memlab-drive.py" "$DRIVE_BINARY" "$DRIVE_CORPUS" "$REQUESTS" --tool "${MEMLAB_TOOL:-search_graph}" --stderr "$DRIVE_STDERR" > "$WORK/drive.out" 2>&1
python3 "$(dirname "$0")/memlab-drive.py" "$DRIVE_BINARY" "$DRIVE_CORPUS" "$REQUESTS" --tool "${MEMLAB_TOOL:-search_graph}" --idle-seconds "${MEMLAB_IDLE:-0}" --stderr "$DRIVE_STDERR" > "$WORK/drive.out" 2>&1
RC=$?
# With CBM_CACHE_DIR set the process logs to its own file rather than stderr,
# so fold that in or the census series is invisible.