diff --git a/requirements.txt b/requirements.txt index 0733397..3ae825e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -39,4 +39,5 @@ typing-inspect==0.9.0 typing_extensions==4.9.0 urllib3==2.2.2 virtualenv==20.25.0 -Jinja2~=3.1.5 \ No newline at end of file +Jinja2~=3.1.5 +psutil~=7.0.0 \ No newline at end of file diff --git a/tests/networking_privacy/test_networking_privacy.py b/tests/networking_privacy/test_networking_privacy.py index aab916e..c2bb207 100644 --- a/tests/networking_privacy/test_networking_privacy.py +++ b/tests/networking_privacy/test_networking_privacy.py @@ -1,9 +1,13 @@ import pytest +import psutil from src.libs.common import delay, to_app_id, to_index +from src.libs.custom_logger import get_custom_logger from src.steps.da import StepsDataAvailability from src.test_data import DATA_TO_DISPERSE +logger = get_custom_logger(__name__) + class TestNetworkingPrivacy(StepsDataAvailability): main_nodes = [] @@ -11,4 +15,15 @@ class TestNetworkingPrivacy(StepsDataAvailability): @pytest.mark.parametrize("setup_2_node_cluster", [1024], indirect=True) def test_consumed_bandwidth_dispersal(self, setup_2_node_cluster): delay(5) + net_io = psutil.net_io_counters() + prev_total = net_io.bytes_sent + net_io.bytes_recv self.disperse_data(DATA_TO_DISPERSE[1], to_app_id(1), to_index(0)) + net_io = psutil.net_io_counters() + curr_total = net_io.bytes_sent + net_io.bytes_recv + + logger.debug(f"prev_total: {prev_total}") + logger.debug(f"curr_total: {curr_total}") + + consumed = curr_total - prev_total + + logger.debug(f"consumed: {consumed}")