fix(bench): clear stale k6 console files and check telemetry storages around lookup

k6 --console-output appends, so a run killed before cleanup left
<run>.warm.k6 in .work and the resumed warmup counted 24 of 12.
Remove the console file before each k6 run and a stale .work at
start; ignore evidence/**/.work/.

A telemetry storage that exits during the lookup (Tempo in
metrics-r3: name no longer resolvable) now fails the run with the
container state, OOMKilled flag and its log tail saved to raw/;
Tempo requests of the lookup are limited to 3 at a time and
memory peaks after the lookup are recorded.

Raise the light classes of the telemetry cost load by 15 % (read
126.5, write 23, me 34.5, card 34.5 per second): on a quiet host
`full` kept the replicas at 28-29.5 % CPU, below the 30 %
calibration bound.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-14 23:42:53 +03:00
co-authored by Claude Opus 5.5
parent 509afca89e
commit 68e14b6ddf
8 changed files with 194 additions and 26 deletions
+18 -3
View File
@@ -4,7 +4,7 @@ Design change `track1-telemetry-cost`, решение 9. Только в кон
`mtusi-bench-lookup` на образе стенда, в сети хранилищ `mtusi-bench-telemetry`;
только stdlib (`urllib`), `src` не импортирует, `bench/` — на чтение. Запросы
— HTTP API Tempo, Loki, Prometheus и метрики Collector, пулом из восьми
потоков.
потоков; к Tempo — не больше трёх запросов одновременно.
python telemetry_lookup.py wait-ready [--timeout 90]
python telemetry_lookup.py collect <события.json> <итог.json>
@@ -20,9 +20,11 @@ Prometheus, квантили из buckets против журнала. Резу
не выдаётся за полный.
"""
import contextlib
import json
import math
import sys
import threading
import time
import urllib.error
import urllib.parse
@@ -43,6 +45,12 @@ READY = (
THREADS = 8
# переходы журнал → трасса: потоков на класс (классы идут параллельно)
LINK_THREADS = 2
# одновременных запросов к Tempo (поиски классов и переходы журнал → трасса):
# под восемью поисками и загрузками трасс сразу Tempo с лимитом рабочего
# стенда (640m без swap) завершился посреди выборки metrics-r3 метки baseline
# (design, «Уточнения apply», п. 16); выборка идёт после окон замера
TEMPO_REQUESTS = 3
TEMPO_GATE = threading.BoundedSemaphore(TEMPO_REQUESTS)
TIMEOUT_S = 60
ATTEMPTS = 4
RETRY_PAUSE_S = 1.0
@@ -195,10 +203,17 @@ def collector_name(expr: str) -> str:
def fetch(url: str) -> bytes:
"""GET с повтором на обрыв соединения и 5xx: хранилище с 0,5 CPU под
пулом запросов изредка закрывает соединение без ответа. 4xx — сразу."""
пулом запросов изредка закрывает соединение без ответа. 4xx — сразу.
Запрос к Tempo ждёт места `TEMPO_GATE`; пауза повтора места не держит."""
for attempt in range(1, ATTEMPTS + 1):
gate = (
TEMPO_GATE if url.startswith(TEMPO) else contextlib.nullcontext()
)
try:
with urllib.request.urlopen(url, timeout=TIMEOUT_S) as response:
with (
gate,
urllib.request.urlopen(url, timeout=TIMEOUT_S) as response,
):
return response.read()
except urllib.error.HTTPError as exc:
if exc.code < 500 or attempt == ATTEMPTS: