Skip to content

Commit

Permalink
fix CI and adding constants
Browse files Browse the repository at this point in the history
Signed-off-by: Elad Gershon <egershon@nvidia.com>
  • Loading branch information
egershonNvidia committed Aug 14, 2024
1 parent fbc1e73 commit c47cb7b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def start_server(port:str,changes_intervals:int, run_forever:bool):
t.daemon = True
t.start()
counters_names = list(counters.keys())
header = ['timestamp', 'source_id,tag,node_guid,Node_GUID,Port_Number'] + counters_names
header = ['timestamp', 'source_id,tag,Node_GUID,port_guid,Port_Number'] + counters_names
endpoint['data'] = ""
while True:
# lock.acquire()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ class PDRConstants(object):
NODE_TYPE_OTHER = "other"
BER_TELEMETRY = "ber_telemetry"

NODE_GUID = "Node_GUID"
PORT_NUMBER = "Port_Number"

ISSUE_PDR = "pdr"
ISSUE_BER = "ber"
ISSUE_PDR_BER = "pdr&ber"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,10 @@ def find_peer_row_for_port(self, port_obj, ports_counters):
return None
peer_guid, peer_num = port_obj.peer.split('_')
# Fix peer guid format for future search
if ports_counters['port_guid'].iloc[0].startswith('0x') and not peer_guid.startswith('0x'):
if ports_counters[Constants.NODE_GUID].iloc[0].startswith('0x') and not peer_guid.startswith('0x'):
peer_guid = f'0x{peer_guid}'
#TODO check for a way to save peer row in data structure for performance
peer_row_list = ports_counters.loc[(ports_counters['port_guid'] == peer_guid) & (ports_counters['port_num'] == int(peer_num))]
peer_row_list = ports_counters.loc[(ports_counters[Constants.NODE_GUID] == peer_guid) & (ports_counters[Constants.PORT_NUMBER] == int(peer_num))]
if peer_row_list.empty:
self.logger.warning(f"Peer port {port_obj.peer} not found in ports data")
return None
Expand Down Expand Up @@ -533,7 +533,7 @@ def read_next_set_of_high_ber_or_pdr_ports(self):
self.logger.error("Couldn't retrieve telemetry data")
return {}
for _, row in ports_counters.iterrows():
port_name = f"{row.get('Node_GUID', '').split('x')[-1]}_{row.get('Port_Number', '')}"
port_name = f"{row.get(Constants.NODE_GUID, '').split('x')[-1]}_{row.get(Constants.PORT_NUMBER, '')}"
if self.exclude_list.contains(port_name):
# The port is excluded from analysis
continue
Expand Down

0 comments on commit c47cb7b

Please sign in to comment.