Expose bounded seed progress for long reconciler experiments
This commit is contained in:
@@ -40,3 +40,6 @@ reconciler1CPU/256MiB; pin последние5ядер VM (2S3,2PG,1CLI). API/LB
|
|||||||
Листинг RustFS может дорожать на ключ и опровергнуть линейную H2. Deep на мелких файлах
|
Листинг RustFS может дорожать на ключ и опровергнуть линейную H2. Deep на мелких файлах
|
||||||
не предсказывает стоимость10MiB. Docker Desktop и хост — общая машина; screen оценивает
|
не предсказывает стоимость10MiB. Docker Desktop и хост — общая машина; screen оценивает
|
||||||
чужой CPU, но не устраняет диск/частоты/кэш. Историческая серия не изолированный baseline.
|
чужой CPU, но не устраняет диск/частоты/кэш. Историческая серия не изолированный baseline.
|
||||||
|
|
||||||
|
Наполнитель выводит обезличенный progress каждые10000 завершённых PUT; он сохраняется в plan.seeds.
|
||||||
|
Во время долгого наполнения можно читать только эти счётчики из logs своего one-off контейнера.
|
||||||
|
|||||||
@@ -653,7 +653,8 @@ def seed(count, env):
|
|||||||
"4",
|
"4",
|
||||||
env=env,
|
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):
|
def median(runs, path):
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ async def seed(count: int, concurrency: int) -> dict[str, object]:
|
|||||||
raise SystemExit("нет ни одного чата: сначала make test")
|
raise SystemExit("нет ни одного чата: сначала make test")
|
||||||
ids = [uuid4() for _ in range(count)]
|
ids = [uuid4() for _ in range(count)]
|
||||||
pending = iter(ids)
|
pending = iter(ids)
|
||||||
|
completed = 0
|
||||||
started = time.monotonic()
|
started = time.monotonic()
|
||||||
async with s3_client(
|
async with s3_client(
|
||||||
endpoint=settings.s3_endpoint,
|
endpoint=settings.s3_endpoint,
|
||||||
@@ -78,8 +79,12 @@ async def seed(count: int, concurrency: int) -> dict[str, object]:
|
|||||||
storage = S3ObjectStorage(client, settings.s3_bucket)
|
storage = S3ObjectStorage(client, settings.s3_bucket)
|
||||||
|
|
||||||
async def worker() -> None:
|
async def worker() -> None:
|
||||||
|
nonlocal completed
|
||||||
for attachment_id in pending:
|
for attachment_id in pending:
|
||||||
await storage.put(f"attachments/{attachment_id}", body, "image/png")
|
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)))
|
await asyncio.gather(*(worker() for _ in range(concurrency)))
|
||||||
stored = time.monotonic()
|
stored = time.monotonic()
|
||||||
|
|||||||
Reference in New Issue
Block a user