fix: review findings (async SQS dispatcher, backoff, batch insert, shutdown order, pagination, HMAC) + loadtest fixes; v0.1.6
This commit is contained in:
+19
-15
@@ -118,22 +118,21 @@ def burst(args):
|
||||
duration=spike, qos=args.qos)
|
||||
tail = _run_publishers(run_id + "-t", ns, devices,
|
||||
rate=args.rate, duration=quiet, qos=args.qos)
|
||||
expected_low = max(1, int(args.rate * quiet))
|
||||
expected_high = max(1, int(args.rate * args.burst_mult * spike))
|
||||
rep = Verifier(api, ns, run_id)
|
||||
# считаем только фазу всплеска (низкие фазы — фон)
|
||||
rep_high = rep.run_report(devices, expected_high)
|
||||
# recovery: сколько времени после окончания всплеска очередь отдала всё
|
||||
# Фазы различаются суффиксом run_id — верифицируем фазу "-h" отдельно.
|
||||
high_sent = high.get("sent", 0)
|
||||
expected_per_device = max(1, high_sent // max(1, len(devices)))
|
||||
rep_high = Verifier(api, ns, run_id + "-h").run_report(
|
||||
devices, expected_per_device)
|
||||
# recovery: сколько времени после конца всплеска очередь отдала всё
|
||||
_, recovery_s = _wait_delivery(
|
||||
api, ns, run_id + "-h", devices, expected_high * len(devices),
|
||||
timeout=300)
|
||||
api, ns, run_id + "-h", devices, high_sent, timeout=300)
|
||||
return {
|
||||
"scenario": "burst",
|
||||
"ns": ns,
|
||||
"quiet_phase": low,
|
||||
"spike_phase": high,
|
||||
"tail_phase": tail,
|
||||
"expected_high_total": expected_high * len(devices),
|
||||
"sent_high_total": high_sent,
|
||||
"recovery_sec": round(recovery_s, 1),
|
||||
"high": rep_high,
|
||||
}
|
||||
@@ -143,6 +142,9 @@ def burst(args):
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# 3. LARGE_PAYLOAD — крупные сообщения
|
||||
# Верификация через API невозможна: строка с большим payload в ответе >15 КБ,
|
||||
# а шлюз платформы рвёт такие ответы (баг MSS/MTU, тикет Nubes). Доставку
|
||||
# проверять по логам монолита: 'consumer: telemetry saved'.
|
||||
# --------------------------------------------------------------------------
|
||||
def large_payload(args):
|
||||
run_id = f"big-{int(time.time())}"
|
||||
@@ -150,15 +152,17 @@ def large_payload(args):
|
||||
api = API()
|
||||
devices = _create_devices(api, ns, run_id, min(args.devices, 10))
|
||||
try:
|
||||
expected = max(1, int(args.rate * args.duration))
|
||||
counters = _run_publishers(
|
||||
run_id, ns, devices, rate=args.rate, duration=args.duration,
|
||||
qos=args.qos, payload_size=args.payload_size)
|
||||
time.sleep(10)
|
||||
rep = Verifier(api, ns, run_id).run_report(devices, expected)
|
||||
rep.update({"scenario": "large_payload", "ns": ns,
|
||||
"publisher": counters})
|
||||
return rep
|
||||
return {
|
||||
"scenario": "large_payload",
|
||||
"ns": ns,
|
||||
"payload_size": args.payload_size,
|
||||
"publisher": counters,
|
||||
"note": "доставку смотреть в логах монолита (telemetry saved); "
|
||||
"API-верификация невозможна из-за бага шлюза (>15KB ответ)",
|
||||
}
|
||||
finally:
|
||||
_cleanup(api, ns, devices)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user