diff --git a/testground/benchmark/benchmark/stateless.py b/testground/benchmark/benchmark/stateless.py index 0280ccf936..f5fe43341c 100644 --- a/testground/benchmark/benchmark/stateless.py +++ b/testground/benchmark/benchmark/stateless.py @@ -167,7 +167,7 @@ def run( # collect outputs output = Path("/data.tar.bz2") with tarfile.open(output, "x:bz2") as tar: - tar.add(home, arcname="data") + tar.add(home, arcname="data", filter=output_filter(group, group_seq)) outdir = Path(outdir) if outdir.exists(): assert outdir.is_dir() @@ -176,6 +176,31 @@ def run( shutil.copy(output, filename) +def output_filter(group, group_seq: int): + """ + filter out some big and useless paths to reduce size of output artifacts + """ + + is_validator_leader = group == VALIDATOR_GROUP and group_seq == 0 + is_fullnode_leader = group == FULLNODE_GROUP and group_seq == 0 + + def inner(info: tarfile.TarInfo): + # only keep one copy + if not is_validator_leader and info.name in ( + "data/data/cs.wal", + "data/data/blockstore.db", + "data/data/application.db", + "data/data/memiavl.db", + "data/data/state.db", + ): + return None + if not is_fullnode_leader and info.name == "data/data/tx_index.db": + return None + return info + + return inner + + def detect_idle(idle_blocks: int, interval: int): """ returns if the chain is empty for consecutive idle_blocks