Skip to content

Commit

Permalink
[counterpoll]: output default value when not configured (sonic-net#289)
Browse files Browse the repository at this point in the history
Signed-off-by: Sihui Han <[email protected]>
  • Loading branch information
sihuihan88 authored Jul 25, 2018
1 parent 7311bff commit 747d5c3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions counterpoll/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ def show():
queue_info = configdb.get_entry('FLEX_COUNTER_TABLE', 'QUEUE')
port_info = configdb.get_entry('FLEX_COUNTER_TABLE', 'PORT')

header = ("Type", "Interval", "Status")
header = ("Type", "Interval (in ms)", "Status")
data = []
if queue_info:
data.append(["QUEUE_STAT", queue_info["POLL_INTERVAL"], queue_info["FLEX_COUNTER_STATUS"]])
data.append(["QUEUE_STAT", queue_info["POLL_INTERVAL"] if 'POLL_INTERVAL' in queue_info else 'default (10000)', queue_info["FLEX_COUNTER_STATUS"] if 'FLEX_COUNTER_STATUS' in queue_info else 'disable' ])
if port_info:
data.append(["PORT_STAT", port_info["POLL_INTERVAL"], port_info["FLEX_COUNTER_STATUS"]])
data.append(["PORT_STAT", port_info["POLL_INTERVAL"] if 'POLL_INTERVAL' in port_info else 'default (1000)', port_info["FLEX_COUNTER_STATUS"] if 'FLEX_COUNTER_STATUS' in port_info else 'disable'])

print tabulate(data, headers=header, tablefmt="simple", missingval="")

0 comments on commit 747d5c3

Please sign in to comment.