Skip to content

Commit

Permalink
[counter] Fix issue: non default counters will be delayed forever aft…
Browse files Browse the repository at this point in the history
…er fastboot (#10413)

- Why I did it
Fastboot will delay all counters in CONFIG DB, it relies on enable_counters.py to recover the delayed counters. However, enable_counters.py does not recover those non-default counters.

- How I did it
For non-default counters, if it is in CONFIG DB, put delay status to false after the waiting.

- How to verify it
Manual test
  • Loading branch information
Junchao-Mellanox authored and pull[bot] committed May 22, 2024
1 parent 4125999 commit a66fa34
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions dockers/docker-orchagent/enable_counters.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,18 @@ def enable_rates():
def enable_counters():
db = swsssdk.ConfigDBConnector()
db.connect()
enable_counter_group(db, 'PORT')
enable_counter_group(db, 'RIF')
enable_counter_group(db, 'QUEUE')
enable_counter_group(db, 'PFCWD')
enable_counter_group(db, 'PG_WATERMARK')
enable_counter_group(db, 'PG_DROP')
enable_counter_group(db, 'QUEUE_WATERMARK')
enable_counter_group(db, 'BUFFER_POOL_WATERMARK')
enable_counter_group(db, 'PORT_BUFFER_DROP')
enable_counter_group(db, 'ACL')
default_enabled_counters = ['PORT', 'RIF', 'QUEUE', 'PFCWD', 'PG_WATERMARK', 'PG_DROP',
'QUEUE_WATERMARK', 'BUFFER_POOL_WATERMARK', 'PORT_BUFFER_DROP', 'ACL']

# Enable those default counters
for key in default_enabled_counters:
enable_counter_group(db, key)

# Set FLEX_COUNTER_DELAY_STATUS to false for those non-default counters
keys = db.get_keys('FLEX_COUNTER_TABLE')
for key in keys:
if key not in default_enabled_counters:
enable_counter_group(db, key)
enable_rates()


Expand Down

0 comments on commit a66fa34

Please sign in to comment.