#1706 - Added some extra logging
This commit is contained in:
@@ -321,12 +321,13 @@ class Link(SimComponent):
|
|||||||
receiver_nic = self.endpoint_a
|
receiver_nic = self.endpoint_a
|
||||||
if receiver_nic == sender_nic:
|
if receiver_nic == sender_nic:
|
||||||
receiver_nic = self.endpoint_b
|
receiver_nic = self.endpoint_b
|
||||||
frame_size = frame.size
|
frame_size = frame.size_Mbits
|
||||||
sent = receiver_nic.receive_frame(frame)
|
sent = receiver_nic.receive_frame(frame)
|
||||||
if sent:
|
if sent:
|
||||||
# Frame transmitted successfully
|
# Frame transmitted successfully
|
||||||
# Load the frame size on the link
|
# Load the frame size on the link
|
||||||
self.current_load += frame_size
|
self.current_load += frame_size
|
||||||
|
_LOGGER.info(f"Link added {frame_size} Mbits, current load {self.current_load} Mbits")
|
||||||
return True
|
return True
|
||||||
# Received NIC disabled, reply
|
# Received NIC disabled, reply
|
||||||
|
|
||||||
@@ -633,6 +634,7 @@ class Node(SimComponent):
|
|||||||
_LOGGER.info(f"Node {self.hostname} attempting to ping {target_ip_address}")
|
_LOGGER.info(f"Node {self.hostname} attempting to ping {target_ip_address}")
|
||||||
self._ping(target_ip_address)
|
self._ping(target_ip_address)
|
||||||
return True
|
return True
|
||||||
|
_LOGGER.info(f"Node {self.hostname} ping failed as the node is turned off")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def send_frame(self, frame: Frame):
|
def send_frame(self, frame: Frame):
|
||||||
|
|||||||
@@ -107,5 +107,5 @@ class Frame(BaseModel):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def size_Mbits(self) -> float: # noqa - Keep it as MBits as this is how they're expressed
|
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)
|
return convert_bytes_to_megabits(self.size)
|
||||||
|
|||||||
Reference in New Issue
Block a user