Skip to content

Conversation

@prgeor
Copy link
Contributor

@prgeor prgeor commented Oct 3, 2025

What I did

Added new CLI "portstat -fh" for displaying the FEC histogram which accounts for clear counter by "portstat -c"

How I did it

Added new CLI

 root@sonic:~# portstat -fh 
 Last cached time was 2025-10-02T16:43:57.934081
       IFACE           BIN0        BIN1       BIN2    BIN3    BIN4    BIN5    BIN6    BIN7    BIN8    BIN9    BIN10    BIN11    BIN12    BIN13    BIN14    BIN15
 -----------  -------------  ----------  ---------  ------  ------  ------  ------  ------  ------  ------  -------  -------  -------  -------  -------  -------
   Ethernet0  4,374,661,575         340          1       0       0       0       0       0       0       0        0        0        0        0        0        0
   Ethernet8  4,374,590,263       8,069          9       0       0       0       0       0       0       0        0        0        0        0        0        0
  Ethernet16  4,374,660,911       3,187          4       0       0       0       0       0       0       0        0        0        0        0        0        0
  Ethernet24  4,374,594,305      57,484        502       0       0       0       0       0       0       0        0        0        0        0        0        0
  Ethernet32  4,374,649,615         116          0       0       0       0       0       0       0       0        0        0        0        0        0        0
  Ethernet40 

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prgeor prgeor merged commit 89c9aef into sonic-net:master Oct 6, 2025
7 checks passed
parser.add_argument('-D', '--delete-all', action='store_true', help='Delete all saved stats')
parser.add_argument('-e', '--errors', action='store_true', help='Display interface errors')
parser.add_argument('-f', '--fec-stats', action='store_true', help='Display FEC related statistics')
parser.add_argument('-fh', '--fec_hist', action='store_true', help='Display FEC histogram')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-fh may lead to confusing. Linux convention is -fh == -f -h

mihirpat1 pushed a commit to mihirpat1/sonic-utilities that referenced this pull request Oct 6, 2025
prgeor added a commit that referenced this pull request Oct 7, 2025
* FEC histogram with ability to clear stat (#4075)

* Removed extra new line

* Correct sequence numbers in counter_bucket_dict

* Using len(counter_bucket_dict) instead of BUCKET_NUM

* Modified BUCKET_NUM to 66 and added FEC counter bin handling in cnstat_print

* Added unit-test to improve code coverage

* Fixed SA warning

---------

Co-authored-by: Prince George <[email protected]>
@r12f
Copy link

r12f commented Oct 7, 2025

hi @mihirpat1 , do you mind to help create a manual PR to 202412?

@r12f
Copy link

r12f commented Oct 19, 2025

hi @mihirpat1 , gently ping again. do you mind to help create a manual PR to 202412?

@mihirpat1
Copy link
Contributor

hi @mihirpat1 , gently ping again. do you mind to help create a manual PR to 202412?

@r12f Per my understanding, this is not planned for 202412. @prgeor Please correct me if I am wrong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants