magic-trace
magic-trace copied to clipboard
destinations.ml: add a compressed_file_destination that uses zstandard
Trace files can be large and hard to share. Using zstd to compress trace files allows users to decrease their file sizes, as demonstrated here:
$ du -sh trace.fxt trace.fxt.zst
472K trace.fxt
56K trace.fxt.zst
This is a preliminary attempt at adding a compressed file destination. We have some open questions that we want to raise in the PR.
One thing we had to do is we had to make an original_filename labeled
argument. This is because, sometimes, magic-trace uses
/proc/self/fd/$FD paths as a way to prevent a race condition when
serving traces.
This addresses #154 (just to link the two)
@Xyene ready for rereview if you have free time!