CLI addition for PFC counters --history#3778
Merged
vmittal-msft merged 3 commits intosonic-net:masterfrom Aug 4, 2025
Merged
Conversation
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
maipbui
reviewed
Apr 2, 2025
maipbui
reviewed
Apr 2, 2025
| print("Last cached time was " + str(cnstat_cached_dict.get('time'))) | ||
| pfcstat.cnstat_diff_print(cnstat_dict_rx, cnstat_cached_dict, True) | ||
| except IOError as e: | ||
| print(e.errno, e) |
Contributor
Author
There was a problem hiding this comment.
Thank you for reviewing!
I updated to address the feedback, but the design has also changed a bit since your comments.
maipbui
reviewed
Apr 2, 2025
3d1fa26 to
1c2a46e
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
1c2a46e to
6a05a96
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
6a05a96 to
49f6568
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
49f6568 to
0f89cf9
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
bb48252 to
b840e94
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Please note the usage of `# flake8: noqa: E501` in assert_show_output.py to account for the length of show command output strings.
b840e94 to
3299035
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
vmittal-msft
approved these changes
Aug 1, 2025
Contributor
|
This change will break sonic-mgmt testcase. @peterbailey-arista Could you fix the testcase? def extract_pfcwd_config(duthost, start_pfcwd):
"""
Extract pfcwd info from running config
Args:
duthost: DUT host object
Yields:
pfcwd_config: dict of dicts with interface as the 1st level key and 'action', 'detect_time',
'restore_time' as the 2nd level keys
"""
output = duthost.command('show pfcwd config')
pytest_assert('Ethernet' in output['stdout'], 'No ports found in the pfcwd config')
pfcwd_config = defaultdict()
for line in output['stdout_lines']:
if line.strip().startswith('Ethernet'):
port, action, detect, restore = line.split()
pfcwd_config.update({port: {'action': action,
'detect_time': detect,
'restore_time': restore}})
yield pfcwd_config |
YairRaviv
pushed a commit
to YairRaviv/sonic-utilities
that referenced
this pull request
Jan 12, 2026
* Add history option to pfcstat cli * Unit tests for pfcstat history cli Please note the usage of `# flake8: noqa: E501` in assert_show_output.py to account for the length of show command output strings. * Add pfc counters history flag to utilities documentation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
pfcstat/show pfc countersThese changes were made for the PFC Historical Statistics feature: sonic-net/SONiC#1904
How I did it
How to verify it
show pfc counters --historyon a switch with these changesNew command output (if the output of a command-line utility has changed)
Example output of
show pfc counters --history