Expose bounded seed progress for long reconciler experiments

This commit is contained in:
Artyom
2026-11-06 02:32:19 +03:00
parent 827b783be3
commit 3402fd69d4
3 changed files with 10 additions and 1 deletions
@@ -40,3 +40,6 @@ reconciler1CPU/256MiB; pin последние5ядер VM (2S3,2PG,1CLI). API/LB
Листинг RustFS может дорожать на ключ и опровергнуть линейную H2. Deep на мелких файлах
не предсказывает стоимость10MiB. Docker Desktop и хост — общая машина; screen оценивает
чужой CPU, но не устраняет диск/частоты/кэш. Историческая серия не изолированный baseline.
Наполнитель выводит обезличенный progress каждые10000 завершённых PUT; он сохраняется в plan.seeds.
Во время долгого наполнения можно читать только эти счётчики из logs своего one-off контейнера.
+2 -1
View File
@@ -653,7 +653,8 @@ def seed(count, env):
"4",
env=env,
)
return json.loads(out.strip().splitlines()[-1])
records = [json.loads(line) for line in out.strip().splitlines()]
return {**records[-1], "progress": records[:-1]}
def median(runs, path):
+5
View File
@@ -65,6 +65,7 @@ async def seed(count: int, concurrency: int) -> dict[str, object]:
raise SystemExit("нет ни одного чата: сначала make test")
ids = [uuid4() for _ in range(count)]
pending = iter(ids)
completed = 0
started = time.monotonic()
async with s3_client(
endpoint=settings.s3_endpoint,
@@ -78,8 +79,12 @@ async def seed(count: int, concurrency: int) -> dict[str, object]:
storage = S3ObjectStorage(client, settings.s3_bucket)
async def worker() -> None:
nonlocal completed
for attachment_id in pending:
await storage.put(f"attachments/{attachment_id}", body, "image/png")
completed += 1
if completed % 10000 == 0 or completed == count:
print(json.dumps({"progress": completed, "target": count}), flush=True)
await asyncio.gather(*(worker() for _ in range(concurrency)))
stored = time.monotonic()