#1706 - Added some extra logging

This commit is contained in:
Chris McCarthy
2023-08-02 22:01:15 +01:00
parent 897dbdf10c
commit 209f934abd
2 changed files with 4 additions and 2 deletions

View File

@@ -321,12 +321,13 @@ class Link(SimComponent):
receiver_nic = self.endpoint_a
if receiver_nic == sender_nic:
receiver_nic = self.endpoint_b
frame_size = frame.size
frame_size = frame.size_Mbits
sent = receiver_nic.receive_frame(frame)
if sent:
# Frame transmitted successfully
# Load the frame size on the link
self.current_load += frame_size
_LOGGER.info(f"Link added {frame_size} Mbits, current load {self.current_load} Mbits")
return True
# Received NIC disabled, reply
@@ -633,6 +634,7 @@ class Node(SimComponent):
_LOGGER.info(f"Node {self.hostname} attempting to ping {target_ip_address}")
self._ping(target_ip_address)
return True
_LOGGER.info(f"Node {self.hostname} ping failed as the node is turned off")
return False
def send_frame(self, frame: Frame):

View File

@@ -107,5 +107,5 @@ class Frame(BaseModel):
@property
def size_Mbits(self) -> float: # noqa - Keep it as MBits as this is how they're expressed
"""The daa transfer size of the Frame in MBits."""
"""The daa transfer size of the Frame in Mbits."""
return convert_bytes_to_megabits(self.size)