Skip to content

Commit 494c6d7

Browse files
authored
[counterpoll] Display the correct default poll interval for watermark counters (#2082)
Signed-off-by: Neetha John <[email protected]> sonic-net/sonic-swss#2031 updated the flex counter polling interval to 60s for watermark counters but the show command wasn't updated to reflect the correct default value What I did Display the correct poll interval for watermark related counters in the 'counterpoll show' command How I did it Update the default interval to be the same as the one updated by the Orchs How to verify it Issue "counterpoll show", the queue, pg and buffer pool watermark should show default 60s Updated the counterpoll unit tests to reflect the same
1 parent 499988e commit 494c6d7

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

counterpoll/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,13 +375,13 @@ def show():
375375
if rif_info:
376376
data.append(["RIF_STAT", rif_info.get("POLL_INTERVAL", DEFLT_1_SEC), rif_info.get("FLEX_COUNTER_STATUS", DISABLE)])
377377
if queue_wm_info:
378-
data.append(["QUEUE_WATERMARK_STAT", queue_wm_info.get("POLL_INTERVAL", DEFLT_10_SEC), queue_wm_info.get("FLEX_COUNTER_STATUS", DISABLE)])
378+
data.append(["QUEUE_WATERMARK_STAT", queue_wm_info.get("POLL_INTERVAL", DEFLT_60_SEC), queue_wm_info.get("FLEX_COUNTER_STATUS", DISABLE)])
379379
if pg_wm_info:
380-
data.append(["PG_WATERMARK_STAT", pg_wm_info.get("POLL_INTERVAL", DEFLT_10_SEC), pg_wm_info.get("FLEX_COUNTER_STATUS", DISABLE)])
380+
data.append(["PG_WATERMARK_STAT", pg_wm_info.get("POLL_INTERVAL", DEFLT_60_SEC), pg_wm_info.get("FLEX_COUNTER_STATUS", DISABLE)])
381381
if pg_drop_info:
382382
data.append(['PG_DROP_STAT', pg_drop_info.get("POLL_INTERVAL", DEFLT_10_SEC), pg_drop_info.get("FLEX_COUNTER_STATUS", DISABLE)])
383383
if buffer_pool_wm_info:
384-
data.append(["BUFFER_POOL_WATERMARK_STAT", buffer_pool_wm_info.get("POLL_INTERVAL", DEFLT_10_SEC), buffer_pool_wm_info.get("FLEX_COUNTER_STATUS", DISABLE)])
384+
data.append(["BUFFER_POOL_WATERMARK_STAT", buffer_pool_wm_info.get("POLL_INTERVAL", DEFLT_60_SEC), buffer_pool_wm_info.get("FLEX_COUNTER_STATUS", DISABLE)])
385385
if acl_info:
386386
data.append([ACL, pg_drop_info.get("POLL_INTERVAL", DEFLT_10_SEC), acl_info.get("FLEX_COUNTER_STATUS", DISABLE)])
387387
if tunnel_info:

tests/counterpoll_test.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717

1818
import counterpoll.main as counterpoll
1919

20-
expected_counterpoll_show = """Type Interval (in ms) Status
20+
expected_counterpoll_show = """Type Interval (in ms) Status
2121
-------------------- ------------------ --------
22-
QUEUE_STAT 10000 enable
23-
PORT_STAT 1000 enable
24-
PORT_BUFFER_DROP 60000 enable
25-
QUEUE_WATERMARK_STAT 10000 enable
26-
PG_WATERMARK_STAT 10000 enable
27-
PG_DROP_STAT 10000 enable
28-
ACL 10000 enable
29-
FLOW_CNT_TRAP_STAT 10000 enable
22+
QUEUE_STAT 10000 enable
23+
PORT_STAT 1000 enable
24+
PORT_BUFFER_DROP 60000 enable
25+
QUEUE_WATERMARK_STAT default (60000) enable
26+
PG_WATERMARK_STAT default (60000) enable
27+
PG_DROP_STAT 10000 enable
28+
ACL 10000 enable
29+
FLOW_CNT_TRAP_STAT 10000 enable
3030
"""
3131

3232
class TestCounterpoll(object):

tests/mock_tables/config_db.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1576,11 +1576,9 @@
15761576
"FLEX_COUNTER_STATUS": "enable"
15771577
},
15781578
"FLEX_COUNTER_TABLE|QUEUE_WATERMARK": {
1579-
"POLL_INTERVAL": "10000",
15801579
"FLEX_COUNTER_STATUS": "enable"
15811580
},
15821581
"FLEX_COUNTER_TABLE|PG_WATERMARK": {
1583-
"POLL_INTERVAL": "10000",
15841582
"FLEX_COUNTER_STATUS": "enable"
15851583
},
15861584
"FLEX_COUNTER_TABLE|PG_DROP": {

0 commit comments

Comments
 (0)