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

L2SS-244: Removed unused variables, name cleanup

parent 9ab2f542
No related branches found
No related tags found
1 merge request!56L2SS-244: Expose the SSTs in MPs
......@@ -47,9 +47,9 @@ class SST(hardware_device):
# SST client annotation consists of a dict that contains the parameter name that needs to be read.
# Example: comms_annotation={"parameter": "this_value_R"}
packet_count_R = attribute_wrapper(comms_annotation={"parameter": "packet_count_R"}, datatype=numpy.int64)
last_packet_timestamp_R = attribute_wrapper(comms_annotation={"parameter": "last_packet_timestamp_R"}, datatype=numpy.int64)
queue_percentage_used_R = attribute_wrapper(comms_annotation={"parameter": "queue_percentage_used_R"}, datatype=numpy.double)
packet_count_R = attribute_wrapper(comms_annotation={"parameter": "nof_packets"}, datatype=numpy.int64)
last_packet_timestamp_R = attribute_wrapper(comms_annotation={"parameter": "last_packet_timestamp"}, datatype=numpy.int64)
queue_percentage_used_R = attribute_wrapper(comms_annotation={"parameter": "queue_fill_percentage"}, datatype=numpy.double)
# --------
# overloaded functions
......
......@@ -158,17 +158,10 @@ class SST(Thread):
self.queue = queue
self.last_packet = None
# holder for the currently constructed SST array,
# actual type will be created on the fly
self.collecting_values = None
# timestamp of the collecting_values
self.collecting_timestamp = datetime.min
self.parameters = {
"packet_count_R": numpy.int64(0),
"last_packet_timestamp_R": numpy.int64(0),
"queue_percentage_used_R": numpy.double(100 * self.queue.qsize() / self.queue.maxsize),
"nof_packets": numpy.uint64(0),
"last_packet_timestamp": numpy.uint64(0),
"queue_fill_percentage": numpy.double(100 * self.queue.qsize() / self.queue.maxsize),
# Packet count for packets that could not be parsed as SSTs
"nof_invalid_packets": numpy.uint64(0),
......@@ -205,9 +198,9 @@ class SST(Thread):
self.join()
def process_packet(self, packet):
self.parameters["packet_count_R"] += 1
self.parameters["last_packet_timestamp_R"] = numpy.int64(int(time.time()))
self.parameters["queue_percentage_used_R"] = numpy.double(100 * self.queue.qsize() / self.queue.maxsize)
self.parameters["nof_packets"] += 1
self.parameters["last_packet_timestamp"] = numpy.uint64(int(time.time()))
self.parameters["queue_fill_percentage"] = numpy.double(100 * self.queue.qsize() / self.queue.maxsize)
try:
fields = StatisticsPacket(packet)
......
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