process replay: use zst (#33138)

* test

* update refs to zst

* update
old-commit-hash: dfd387520e88fa68f0485b6ce8dcf5befa82bafa
This commit is contained in:
Shane Smiskol
2024-07-30 01:46:03 -07:00
committed by GitHub
parent 7ea8d9e91d
commit 7ce33fbe2b
4 changed files with 8 additions and 6 deletions
+3 -1
View File
@@ -30,8 +30,10 @@ RawLogIterable = Iterable[bytes]
def save_log(dest, log_msgs, compress=True):
dat = b"".join(msg.as_builder().to_bytes() for msg in log_msgs)
if compress:
if compress and dest.endswith(".bz2"):
dat = bz2.compress(dat)
elif compress and dest.endswith(".zst"):
dat = zstd.compress(dat, 10)
with open(dest, "wb") as f:
f.write(dat)