feat: add download metric unit to experiment config to ease analysis

This commit is contained in:
gmega 2025-02-14 18:35:46 -03:00
parent 0530b4a10b
commit 95651ad9d7
No known key found for this signature in database
GPG Key ID: 6290D34EAD824B18
2 changed files with 9 additions and 0 deletions

View File

@ -79,6 +79,8 @@ class CodexExperimentConfig(ExperimentBuilder[CodexDisseminationExperiment]):
description="Time to wait after the last download completes before tearing down the experiment.",
)
download_metric_unit_bytes: int = 1
nodes: List[CodexNodeConfig] | CodexNodeSetConfig
def build(self) -> CodexDisseminationExperiment:

View File

@ -89,6 +89,13 @@ class DelugeExperimentConfig(ExperimentBuilder[DelugeDisseminationExperiment]):
description="Time to wait after the last download completes before tearing down the experiment.",
)
# The torrent piece size is set at torrent creation time by torrentool
# https://github.com/idlesign/torrentool/blob/5f37d6dcc304758bae46d01c63e5be0f0a348bfc/torrentool/torrent.py#L354
# Sadly we can't easily get this elsewhere.
# XXX this is not a great solution, by the way. The piece size should be reported by the torrent creation tool,
# perhaps even by the torrent client. Having it here can very easily lead to inconsistencies.
download_metric_unit_bytes: int = 262144
def build(self) -> DelugeDisseminationExperiment:
nodes_specs = (
self.nodes.nodes