Skip to content
Snippets Groups Projects
Commit 3b971291 authored by Jan David Mol's avatar Jan David Mol
Browse files

L2SS-244: Initialise parameters in the right class, added comments.

parent f5c1c250
No related branches found
No related tags found
1 merge request!56L2SS-244: Expose the SSTs in MPs
......@@ -124,8 +124,14 @@ class UDP_Receiver(Thread):
self.disconnect_timeout = disconnect_timeout
self.parameters = {
"nof_packets_received": numpy.uint64(0),
"nof_packets_dropped": numpy.uint64(0),
# Number of packets we received
"nof_packets_received": numpy.uint64(0),
# Number of packets we had to drop due to a full queue
"nof_packets_dropped": numpy.uint64(0),
# Packets are at most 9000 bytes, the largest payload (well, MTU) of an Ethernet Jumbo frame
"last_packet": numpy.zeros((9000,), dtype=numpy.uint8),
# Timestamp of when the last packet was received
"last_packet_timestamp": numpy.uint64(0),
}
logger.debug("binding a socket on UDP port {}:{}".format(self.host, self.port))
......@@ -154,7 +160,6 @@ class UDP_Receiver(Thread):
while self.stream_on:
try:
# Packets are at most 9000 bytes, the largest payload (well, MTU) of an Ethernet Jumbo frame
packet, _, _, _ = self.sock.recvmsg(9000)
self.parameters["nof_packets_received"] += numpy.uint64(1)
......@@ -212,8 +217,6 @@ class SST_collector(Thread):
self.parameters = {
"nof_packets": numpy.uint64(0),
"last_packet": numpy.zeros((9000,), dtype=numpy.uint8),
"last_packet_timestamp": numpy.uint64(0),
"queue_fill_percentage": numpy.float32(self.queue_fill_percentage()),
# Packet count for packets that could not be parsed as SSTs
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment