Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[watermarkstat] Add new warning message for the 'q_shared_multi' counters #9

Closed
wants to merge 1 commit into from
Closed
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
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 the COUNTERS_DB is empty because the multicast queues are not configured in the 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