def print_sequence_number_statistics(self): seq_no_set = set(point.sequence_number for point in self.data_points) print("Missing sequence numbers: {} out of {}".format( max(seq_no_set) - min(seq_no_set) + 1 - len(seq_no_set), len(seq_no_set))) print("Duplicated packets: {}".format( len(self.data_points) - len(seq_no_set))) print("Reordered packets: {}".format( misc.count_reordered( [point.sequence_number for point in self.data_points])))
def print_sequence_number_statistics(self): seq_no_set = set(point.sequence_number for point in self.data_points) missing_sequence_numbers = max(seq_no_set) - min(seq_no_set) + (1 - len(seq_no_set)) print( "Missing sequence numbers: {} out of {} ({:.2f}%)".format( missing_sequence_numbers, len(seq_no_set), 100 * missing_sequence_numbers / len(seq_no_set) ) ) print("Duplicated packets: {}".format(len(self.data_points) - len(seq_no_set))) print( "Reordered packets: {}".format(misc.count_reordered([point.sequence_number for point in self.data_points])) )