diff --git a/benchmarks/deluge/agent/agent.py b/benchmarks/deluge/agent/agent.py index b3ddfd6..d23f13a 100644 --- a/benchmarks/deluge/agent/agent.py +++ b/benchmarks/deluge/agent/agent.py @@ -1,3 +1,4 @@ +import logging from pathlib import Path from typing import Optional @@ -5,6 +6,8 @@ from torrentool.torrent import Torrent from benchmarks.core.utils import random_data, megabytes +logger = logging.getLogger(__name__) + class DelugeAgent: def __init__(self, torrents_path: Path, batch_size: int = megabytes(50)): @@ -15,6 +18,8 @@ class DelugeAgent: torrent_path = self.torrents_path / name torrent_path.mkdir(parents=True, exist_ok=False) + logger.info(f"Creating torrent {name} with size {size} and seed {seed}") + file_path = torrent_path / "datafile.bin" with file_path.open(mode="wb") as output: random_data(size=size, outfile=output, seed=seed) @@ -22,4 +27,6 @@ class DelugeAgent: torrent = Torrent.create_from(torrent_path) torrent.name = name + logger.info(f"Torrent {name} created successfully") + return torrent diff --git a/benchmarks/deluge/agent/client.py b/benchmarks/deluge/agent/client.py index 3bf3a9d..1a28379 100644 --- a/benchmarks/deluge/agent/client.py +++ b/benchmarks/deluge/agent/client.py @@ -1,6 +1,7 @@ import socket import requests +from requests import ConnectionError from tenacity import stop_after_attempt, wait_exponential, retry from torrentool.torrent import Torrent from urllib3.util import Url diff --git a/experiments.k8s.yaml b/experiments.k8s.yaml index 12e71c3..cabc320 100644 --- a/experiments.k8s.yaml +++ b/experiments.k8s.yaml @@ -13,7 +13,7 @@ deluge_experiment: # Setting the correct name is critical, and it has to match what's in deluge the StatefulSet. name: "${DELUGE_STATEFULSET}-{node_index}" address: "${DELUGE_STATEFULSET}-{node_index}.${DELUGE_SERVICE}.${NAMESPACE}.svc.cluster.local" - agent_url: "http://${DELUGE_STATEFULSET}-{node_index}.${DELUGE_SERVICE}.${NAMESPACE}:${DELUGE_AGENT_PORT}/" + agent_url: "http://${DELUGE_STATEFULSET}-{node_index}.${DELUGE_SERVICE}.${NAMESPACE}:9001/" daemon_port: 6890 listen_ports: [ 6891, 6892 ] diff --git a/k8s/charts/deluge/templates/testrunner-job.yaml b/k8s/charts/deluge/templates/testrunner-job.yaml index 8994c9a..45c7825 100644 --- a/k8s/charts/deluge/templates/testrunner-job.yaml +++ b/k8s/charts/deluge/templates/testrunner-job.yaml @@ -48,9 +48,7 @@ spec: valueFrom: fieldRef: fieldPath: metadata.namespace - volumeMounts: - - name: benchmark-volume - mountPath: /opt/bittorrent-benchmarks/volume + resources: requests: cpu: "1"