From aeee7d90089dce55f47564d5987f1048e51bb46a Mon Sep 17 00:00:00 2001 From: Jan David Mol <mol@astron.nl> Date: Tue, 15 Jun 2021 04:37:45 +0200 Subject: [PATCH] L2SS-244: Make sure counters stay of type uint64 --- devices/clients/sst_client.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/devices/clients/sst_client.py b/devices/clients/sst_client.py index 17aad5dae..a63b04067 100644 --- a/devices/clients/sst_client.py +++ b/devices/clients/sst_client.py @@ -202,7 +202,7 @@ class SST_collector(Thread): super().join(timeout) def process_packet(self, packet): - self.parameters["nof_packets"] += 1 + self.parameters["nof_packets"] += numpy.uint64(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 if self.queue.maxsize else 0) @@ -210,28 +210,28 @@ class SST_collector(Thread): fields = StatisticsPacket(packet) except ValueError: # could not parse header - self.parameters["nof_invalid_packets"] += 1 + self.parameters["nof_invalid_packets"] += numpy.uint64(1) return if fields.marker != 'S': # packet is not SST - self.parameters["nof_invalid_packets"] += 1 + self.parameters["nof_invalid_packets"] += numpy.uint64(1) return input_index = fields.sst_signal_input_index if input_index >= self.MAX_INPUTS: # packet describes an input that is out of bounds for us - self.parameters["nof_invalid_packets"] += 1 + self.parameters["nof_invalid_packets"] += numpy.uint64(1) return if fields.payload_error: # cannot trust the data if a payload error is reported - self.parameters["nof_payload_errors"][input_index] += 1 + self.parameters["nof_payload_errors"][input_index] += numpy.uint64(1) return # process the packet - self.parameters["nof_valid_packets"][input_index] += 1 + self.parameters["nof_valid_packets"][input_index] += numpy.uint64(1) self.parameters["last_values"][input_index][:fields.nof_statistics_per_packet] = fields.payload_sst self.parameters["last_timestamps"][input_index] = numpy.float64(fields.timestamp().timestamp()) self.parameters["integration_intervals"][input_index] = fields.integration_interval() -- GitLab