mirror of
https://github.com/logos-co/nomos-e2e-tests.git
synced 2025-02-24 12:18:12 +00:00
test: consumed bandwidth measurement
This commit is contained in:
parent
f11208c649
commit
dd32fe1987
@ -40,3 +40,4 @@ typing_extensions==4.9.0
|
||||
urllib3==2.2.2
|
||||
virtualenv==20.25.0
|
||||
Jinja2~=3.1.5
|
||||
psutil~=7.0.0
|
@ -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}")
|
||||
|
Loading…
x
Reference in New Issue
Block a user