improve logs for static experiment

This commit is contained in:
gmega 2024-12-06 14:18:30 -03:00
parent cbd4a65775
commit 890d57a589
No known key found for this signature in database
GPG Key ID: 6290D34EAD824B18
3 changed files with 8 additions and 2 deletions

View File

@ -29,13 +29,13 @@ class StaticDisseminationExperiment(Generic[TNetworkHandle, TInitialMetadata], E
with self.data as (meta, data):
cid = None
logger.info('Seeding data')
for node in seeders:
logger.info(f'Seeding data: {str(node)}')
cid = node.seed(data, meta if cid is None else cid)
assert cid is not None # to please mypy
logger.info('Setting up leechers')
logger.info(f'Setting up leechers: {str(leechers)}')
downloads = [node.leech(cid) for node in leechers]
logger.info('Now waiting for downloads to complete')

View File

@ -147,6 +147,9 @@ class DelugeNode(SharedFSNode[Torrent, DelugeMeta], ExperimentComponent):
buffer.write(handle.to_string())
return base64.b64encode(buffer.getvalue())
def __str__(self):
return f"DelugeNode({self.name}, {self.daemon_args['host']}:{self.daemon_args['port']})"
class DelugeDownloadHandle(DownloadHandle):

View File

@ -17,3 +17,6 @@ class Tracker(ExperimentComponent):
return True
except (ConnectionError, socket.gaierror):
return False
def __str__(self) -> str:
return f'Tracker({self.announce_url})'