Сохранять из логов прогона только изменения состояния балансировщика и реплик, сжимать посекундные метрики

This commit is contained in:
2026-11-04 17:24:56 +03:00
parent 940bc6f9f7
commit ecf89efc39
3 changed files with 19 additions and 3 deletions
+8 -2
View File
@@ -20,6 +20,7 @@ under 1 % errors, p99 of successful requests within 500 ms). Charts show the
median of the repeats; a hollow marker means the generator fell behind.
"""
import csv
import gzip
import json
import pathlib
import statistics
@@ -40,10 +41,15 @@ COMPONENTS = ("api", "lb", "postgres", "valkey", "loadgen")
def read_jsonl(path):
if not path.exists():
packed = path.with_name(path.name + ".gz")
if packed.exists():
text = gzip.decompress(packed.read_bytes()).decode("utf-8")
elif path.exists():
text = path.read_text(encoding="utf-8")
else:
return []
rows = []
for line in path.read_text(encoding="utf-8").splitlines():
for line in text.splitlines():
line = line.strip()
if line:
try: