Merge pull request 'Fix benchmark log extraction: first tier match, increase log tail to 300' (#12) from fix/benchmark-log-extraction into main

Reviewed-on: #12
This commit was merged in pull request #12.
This commit is contained in:
2026-03-24 02:43:26 +00:00

View File

@@ -120,7 +120,7 @@ def extract_tier_from_logs(logs_before: str, logs_after: str) -> str | None:
"""Find new tier= lines that appeared after we sent the query."""
before_lines = set(logs_before.splitlines())
new_lines = [l for l in logs_after.splitlines() if l not in before_lines]
for line in reversed(new_lines):
for line in new_lines:
m = re.search(r"tier=(\w+(?:\s*\(dry-run\))?)", line)
if m:
tier_raw = m.group(1)
@@ -203,7 +203,7 @@ async def run(queries: list[dict], dry_run: bool = False) -> list[dict]:
print(f"{qid:>3} {expected:8} ", end="", flush=True)
logs_before = get_log_tail(80)
logs_before = get_log_tail(300)
t0 = time.monotonic()
ok_post = await post_message(client, qid, query_text, dry_run=send_dry)
@@ -225,7 +225,7 @@ async def run(queries: list[dict], dry_run: bool = False) -> list[dict]:
# Now the query is done — check logs for tier
await asyncio.sleep(0.3)
logs_after = get_log_tail(80)
logs_after = get_log_tail(300)
actual = extract_tier_from_logs(logs_before, logs_after)
elapsed = time.monotonic() - t0