Skip to content

Commit

Permalink
[watermarkstat] Add new warning message for the 'q_shared_multi' coun…
Browse files Browse the repository at this point in the history
…ters in case if they not in COUNTES_DB

Signed-off-by: Vadym Hlushko <[email protected]>
  • Loading branch information
vadymhlushko-mlnx committed Sep 28, 2022
1 parent 99ed8ea commit 4ac1c9b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions scripts/watermarkstat
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class Watermarkstat(object):

return pg_index

def build_header(self, wm_type):
def build_header(self, wm_type, counter_type):
if wm_type is None:
print("Header info is not available!", file=sys.stderr)
sys.exit(1)
Expand All @@ -220,8 +220,12 @@ class Watermarkstat(object):
min_idx = element_idx

if min_idx == sys.maxsize:
print("Object map is empty!", file=sys.stderr)
sys.exit(1)
if counter_type != 'q_shared_multi':
print("Object map is empty!", file=sys.stderr)
sys.exit(1)
else:
print("Object map from COUNTERS_DB is empty, because multicast queues are not configured in CONFIG_DB!")
sys.exit(0)

self.min_idx = min_idx
self.header_list += ["{}{}".format(wm_type["header_prefix"], idx) for idx in range(self.min_idx, max_idx + 1)]
Expand Down Expand Up @@ -261,7 +265,7 @@ class Watermarkstat(object):
data = STATUS_NA
table.append((buf_pool, data))
else:
self.build_header(type)
self.build_header(type, key)
# Get stat for each port
for port in natsorted(self.counter_port_name_map):
row_data = list()
Expand Down

0 comments on commit 4ac1c9b

Please sign in to comment.