mirror of
https://github.com/codex-storage/bittorrent-benchmarks.git
synced 2025-01-09 11:02:03 +00:00
improve logs for static experiment
This commit is contained in:
parent
cbd4a65775
commit
890d57a589
@ -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')
|
||||
|
@ -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):
|
||||
|
||||
|
@ -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})'
|
||||
|
Loading…
x
Reference in New Issue
Block a user