Skip to content

Conversation

apoorv-arista
Copy link

@apoorv-arista apoorv-arista commented Sep 8, 2025

Add support to view FEC FLR (Frame Loss Ratio) statistics in
port counter statistics.

This includes

  • FEC_FLR - observed FLR
  • FEC_FLR_PREDICTED - predicted FLR computed by linear regression.

can be verified by viewing fec-stats either by portstat -f or show interfaces counters fec-stats

Feature HLD : port_fec_flr.md

What I did

Added FEC FLR (Frame Loss Ratio) statistics support to port counters display, including both actual and predicted FLR values.

How I did it

Added format_fec_flr() function to format FLR values consistently
Extended header_fec_only to include FEC_FLR and FEC_FLR_PREDICTED columns
Updated RateStats namedtuple to include fec_flr and fec_flr_predicted fields
Modified port statistics collection to retrieve FLR values from CHASSIS_STATE_DB
Updated display formatting to show FLR columns in fec-stats output

How to verify it

Run show interfaces counters fec-stats command and verify the output includes the new FEC_FLR and FEC_FLR_PREDICTED columns with properly formatted values.

Previous command output (if the output of a command-line utility has changed)

admin@ctd615:~$ show interfaces counters fec-stats
      IFACE    STATE    FEC_CORR    FEC_UNCORR    FEC_SYMBOL_ERR    FEC_PRE_BER    FEC_POST_BER    FEC_PRE_BER_MAX
-----------  -------  ----------  ------------  ----------------  -------------  --------------    ---------------
 Ethernet0        U           0             0                 0        1.48e-20        0.00e+00           1.78e-16
 Ethernet8        U           0             0                 0        1.98e-19        0.00e+00           1.67e-14
Ethernet16        U           0             0                 0        1.77e-20        0.00e+00           1.37e-13

New command output (if the output of a command-line utility has changed)

admin@ctd615:~$ show interfaces counters fec-stats
      IFACE    STATE    FEC_CORR    FEC_UNCORR    FEC_SYMBOL_ERR    FEC_PRE_BER    FEC_POST_BER    FEC_PRE_BER_MAX    FEC_FLR    FEC_FLR_PREDICTED
-----------  -------  ----------  ------------  ----------------  -------------  --------------    ---------------  ---------  -------------------
 Ethernet0        U           0             0                 0        1.48e-20        0.00e+00           1.78e-16          0                    0
 Ethernet8        U           0             0                 0        1.98e-19        0.00e+00           1.67e-14          0                    0
Ethernet16        U           0             0                 0        1.77e-20        0.00e+00           1.37e-13          0                    0

- Add FEC_FLR and FEC_FLR_PREDICTED columns to fec-stats display
- Implement format_fec_flr() function for displaying FLR values
- Update RateStats namedtuple to include fec_flr fields
- Update test expectations with new columns
- Update documentation example with new FLR columns

Signed-off-by: Apoorv Sachan <[email protected]>
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@prgeor
Copy link
Contributor

prgeor commented Sep 29, 2025

@apoorv-arista please fix the build errors

Also, update the PR as per the HLD

Can you put the link to the HLD in the PR description?

@prgeor
Copy link
Contributor

prgeor commented Oct 6, 2025

@apoorv-arista please resolve the conflict

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants