Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions py-scripts/lf_interop_qos.py
Original file line number Diff line number Diff line change
Expand Up @@ -955,13 +955,16 @@ def monitor(self, curr_coordinate=None, curr_rotation=None, monitor_charge_time=
t_response[cx] = [0, 0, 0.0, 0.0]
matched_cx = set()
for cx in cx_list:
# track which side (A/B) each tos actually got data for this round
tos_sides_seen = {}
for i in l3_endp_data:
key, cx_data = next(iter(i.items()))
cx_name = key[0:-2]
if cx == cx_name:
matched_cx.add(cx_name)
traffic_tos = key.split('_')[-1].split('-')[0]
endp = key[-1]
tos_sides_seen.setdefault(traffic_tos, set()).add(endp)

if endp == 'A':
self.real_time_data[cx_name][traffic_tos]['bps rx a'].append(cx_data['rx rate (last)'] / 1000000)
Expand All @@ -973,7 +976,16 @@ def monitor(self, curr_coordinate=None, curr_rotation=None, monitor_charge_time=
t_response[cx_name][1] = cx_data['rx rate (last)']
self.real_time_data[cx_name][traffic_tos]['rx drop % b'].append(cx_data['rx drop %'])
t_response[cx_name][3] = cx_data['rx drop %']
self.real_time_data[cx_name][traffic_tos]['time'].append(datetime.now().strftime('%H:%M:%S'))
# fill 0 for whichever side didn't report, so every list for this tos stays the same length
for traffic_tos, sides in tos_sides_seen.items():
tos_data = self.real_time_data[cx][traffic_tos]
if 'A' not in sides:
tos_data['bps rx a'].append(0.0)
tos_data['rx drop % a'].append(0.0)
if 'B' not in sides:
tos_data['bps rx b'].append(0.0)
tos_data['rx drop % b'].append(0.0)
tos_data['time'].append(datetime.now().strftime('%H:%M:%S'))
# warn once when a CX drops out of this tick's data, and log once when it reappears
for cx in cx_list:
if cx not in matched_cx:
Expand Down Expand Up @@ -1985,9 +1997,6 @@ def generate_individual_graph(self, res, report, connections_download_avg, conne
res.pop("throughput_table_df")
if "graph_df" in res:
res.pop("graph_df")
logger.info(res)
logger.info(load)
logger.info(data_set)
# If a CSV filename is provided, retrieve the expected values for each device from the CSV file
if not self.expected_passfail_val and self.csv_name:
test_input_list = self.get_csv_expected_val()
Expand Down Expand Up @@ -2526,9 +2535,9 @@ def generate_individual_graph(self, res, report, connections_download_avg, conne
try:
cx_df = pd.DataFrame(self.real_time_data[cx][tos])
cx_df.to_csv('{}/{}_{}_realtime_data{}.csv'.format(report.path_date_time, cx, tos, graph_no), index=False)
except Exception:
logger.info(f'failed cx {cx} tos {tos}')
logger.info(f"overall Data {self.real_time_data}")
except Exception as e:
column_lengths = {key: len(val) for key, val in self.real_time_data[cx][tos].items()}
logger.warning(f'Failed to write real-time CSV for cx {cx} tos {tos}: {e} (column lengths: {column_lengths})')

def get_pass_fail_list(self, test_input_list, individual_avgupload_list, individual_avgdownload_list):
pass_fail_list = []
Expand Down
Loading