Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add transceiver pm CLI for advanced window-based performance monitoring #2927

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

longhuan-cisco
Copy link
Contributor

@longhuan-cisco longhuan-cisco commented Jul 26, 2023

HLD can be found here:
sonic-net/SONiC#1258
Backend PRs:
sonic-net/sonic-platform-common#387
sonic-net/sonic-platform-daemons#390

What I did

According to window-based PM HLD, add the advanced CLI for it.

How I did it

  1. CLI show interfaces transceiver pm current <window_size{60sec/15min/24hrs}> will show the current PM data for the particular window_size (can be either 60sec/15min/24hrs)

  2. CLI show interfaces transceiver pm history <window_size{60sec/15min/24hrs}> window <window_index{int}> will show the history PM data for the last Nth window(window_index) for the particular window_size.

How to verify it

With dummy pm DB data, verified CLI output with different combination of current/history window_size/window_index options.

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

Today's pm CLI (show int trans pm) doesn't have current/history subcommand for window based data.
Output format is still the same.

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

root@sonic:/home/cisco# show interfaces transceiver pm current 60sec Ethernet0 -n asic0                                                                                                                                                        
Mon Jul 31 17:13:52 UTC 2023
PM window: 60sec                                                                                                                                                                                                                  
Ethernet0:                                                                                                                                                                                                                        
    PM window start time: Mon Jul 31 17:12:49 UTC 2023
    PM window end time:   Mon Jul 31 17:13:50 UTC 2023
    Parameter        Unit    Min       Avg       Max       Threshold    Threshold    Threshold     Threshold    Threshold    Threshold
                                                           High         High         Crossing      Low          Low          Crossing
                                                           Alarm        Warning      Alert-High    Alarm        Warning      Alert-Low
    ---------------  ------  --------  --------  --------  -----------  -----------  ------------  -----------  -----------  -----------
    Tx Power         dBm     -8.19     -8.17     -8.15     -5           -6           False         -16.99       -16.003      False
    Rx Total Power   dBm     -8.61     -8.56     -8.51     2            0            False         -21          -18          False
    Rx Signal Power  dBm     -9.12     -9.09     -9.07     13           10           False         -18          -15          False
    CD-short link    ps/nm   -2        -1        0         1000         500          False         -1000        -500         False
    PDL              dB      0.3       0.3       0.4       4            4            False         0            0            False
    OSNR             dB      36.4      36.4      36.4      99           99           False         0            0            False
    eSNR             dB      17.9      18        18.2      99           99           False         0            0            False
    CFO              MHz     -776      -659      -546      3800         3800         False         -3800        -3800        False
    DGD              ps      2         2         2         7            7            False         0            0            False
    SOPMD            ps^2    26        34        44        655.35       655.35       False         0            0            False
    SOP ROC          krad/s  0         0         0         N/A          N/A          N/A           N/A          N/A          N/A
    Pre-FEC BER      N/A     5.37E-04  5.55E-04  5.80E-04  1.25E-02     1.10E-02     False         0            0            False
    Post-FEC BER     N/A     0         0         0         1.00E+03     1.00E+00     False         0            0            False
    EVM              %       0         0         0         N/A          N/A          N/A           N/A          N/A          N/A



root@sonic:/home/cisco# show interfaces transceiver pm history 60sec window 1 Ethernet0 -n asic0
Mon Jul 31 17:13:52 UTC 2023
PM window: 60sec
Ethernet0: 
    PM window start time: Mon Jul 31 17:11:48 UTC 2023
    PM window end time:   Mon Jul 31 17:12:49 UTC 2023
    Parameter        Unit    Min       Avg       Max       Threshold    Threshold    Threshold     Threshold    Threshold    Threshold
                                                           High         High         Crossing      Low          Low          Crossing
                                                           Alarm        Warning      Alert-High    Alarm        Warning      Alert-Low
    ---------------  ------  --------  --------  --------  -----------  -----------  ------------  -----------  -----------  -----------
    Tx Power         dBm     -8.17     -8.16     -8.15     -5           -6           False         -16.99       -16.003      False
    Rx Total Power   dBm     -8.66     -8.6      -8.53     2            0            False         -21          -18          False
    Rx Signal Power  dBm     -9.15     -9.12     -9.07     13           10           False         -18          -15          False
    CD-short link    ps/nm   -2        0         2         1000         500          False         -1000        -500         False
    PDL              dB      0.3       0.3       0.4       4            4            False         0            0            False
    OSNR             dB      36.4      36.4      36.4      99           99           False         0            0            False
    eSNR             dB      17.9      18.1      18.2      99           99           False         0            0            False
    CFO              MHz     -768      -660      -561      3800         3800         False         -3800        -3800        False
    DGD              ps      2         2         2         7            7            False         0            0            False
    SOPMD            ps^2    26        34        42        655.35       655.35       False         0            0            False
    SOP ROC          krad/s  0         0         0         N/A          N/A          N/A           N/A          N/A          N/A
    Pre-FEC BER      N/A     5.30E-04  5.49E-04  5.82E-04  1.25E-02     1.10E-02     False         0            0            False
    Post-FEC BER     N/A     0         0         0         1.00E+03     1.00E+00     False         0            0            False
    EVM              %       0         0         0         N/A          N/A          N/A           N/A          N/A          N/A



root@sonic:/home/cisco# show interfaces transceiver pm history 60sec window 2 Ethernet0 -n asic0
Mon Jul 31 17:13:52 UTC 2023   
PM window: 60sec
Ethernet0: 
    PM window start time: Mon Jul 31 17:10:48 UTC 2023
    PM window end time:   Mon Jul 31 17:11:48 UTC 2023
    Parameter        Unit    Min       Avg       Max       Threshold    Threshold    Threshold     Threshold    Threshold    Threshold
                                                           High         High         Crossing      Low          Low          Crossing
                                                           Alarm        Warning      Alert-High    Alarm        Warning      Alert-Low
    ---------------  ------  --------  --------  --------  -----------  -----------  ------------  -----------  -----------  -----------
    Tx Power         dBm     -8.17     -8.15     -8.12     -5           -6           False         -16.99       -16.003      False
    Rx Total Power   dBm     -8.65     -8.6      -8.56     2            0            False         -21          -18          False
    Rx Signal Power  dBm     -9.14     -9.11     -9.08     13           10           False         -18          -15          False
    CD-short link    ps/nm   -3        -1        0         1000         500          False         -1000        -500         False
    PDL              dB      0.3       0.3       0.4       4            4            False         0            0            False
    OSNR             dB      36.4      36.4      36.4      99           99           False         0            0            False
    eSNR             dB      18        18.1      18.3      99           99           False         0            0            False
    CFO              MHz     -761      -658      -560      3800         3800         False         -3800        -3800        False
    DGD              ps      2         2         2         7            7            False         0            0            False
    SOPMD            ps^2    25        34        46        655.35       655.35       False         0            0            False
    SOP ROC          krad/s  0         0         0         N/A          N/A          N/A           N/A          N/A          N/A
    Pre-FEC BER      N/A     5.31E-04  5.52E-04  5.64E-04  1.25E-02     1.10E-02     False         0            0            False
    Post-FEC BER     N/A     0         0         0         1.00E+03     1.00E+00     False         0            0            False
    EVM              %       0         0         0         N/A          N/A          N/A           N/A          N/A          N/A




error cases:

root@sonic:/home/cisco# show int trans pm 
Usage: show int trans pm [OPTIONS] COMMAND [ARGS]...

  Display performance monitoring information

Options:
  -h, -?, --help  Show this message and exit.

Commands:
  current  Show PM stats of progressing window for the given window size
  history  Show PM stats of a given window number for the given window size


root@sonic:/home/cisco# show int trans pm current
Usage: show int trans pm current [OPTIONS] [60sec|15min|24hrs] [INTERFACENAME]
Try "show int trans pm current -h" for help.

Error: Missing argument "[60sec|15min|24hrs]".  Choose from:
        60sec,
        15min,
        24hrs.


root@sonic:/home/cisco# show int trans pm history
Usage: show int trans pm history [OPTIONS] [60sec|15min|24hrs] COMMAND
                                 [ARGS]...

  Show PM stats of a given window number for the given window size

Options:
  -?, -h, --help  Show this message and exit.

Commands:
  window  PM window number; 60sec: (1 to 14), 15min: (1 to 11), 24hrs: (1)


root@sonic:/home/cisco# show int trans pm history 60sec
Usage: show int trans pm history [OPTIONS] [60sec|15min|24hrs] COMMAND
                                 [ARGS]...
Try "show int trans pm history -h" for help.

Error: Missing command.


root@sonic:/home/cisco# show int trans pm history 60min
Usage: show int trans pm history [OPTIONS] [60sec|15min|24hrs] COMMAND
                                 [ARGS]...
Try "show int trans pm history -h" for help.

Error: Invalid value for "[60sec|15min|24hrs]": invalid choice: 60min. (choose from 60sec, 15min, 24hrs)
root@sonic:/home/cisco# show int trans pm history 60sec window
Usage: show int trans pm history window [OPTIONS] WINDOW_INDEX [INTERFACENAME]
Try "show int trans pm history window -h" for help.

Error: Missing argument "WINDOW_INDEX".


root@sonic:/home/cisco# show int trans pm history 60sec window 100
Usage: show int trans pm history window [OPTIONS] WINDOW_INDEX [INTERFACENAME]

Error: For 60sec window size, window_index should be between 1 and 14.

@longhuan-cisco
Copy link
Contributor Author

@ jaganbal-a @prgeor @mihirpat1 Please take look at the PR.

scripts/sfpshow Show resolved Hide resolved
scripts/sfpshow Show resolved Hide resolved
scripts/sfpshow Show resolved Hide resolved
show/interfaces/__init__.py Outdated Show resolved Hide resolved
show/interfaces/__init__.py Outdated Show resolved Hide resolved
show/interfaces/__init__.py Show resolved Hide resolved
Copy link

@jaganbal-a jaganbal-a left a comment

Choose a reason for hiding this comment

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

Looks good to me.

abdosi
abdosi previously approved these changes Feb 1, 2024
@rlhui
Copy link
Contributor

rlhui commented Apr 8, 2024

@longhuan-cisco please help resolve conflicts, thanks.

@bmridul
Copy link
Contributor

bmridul commented May 6, 2024

@prgeor , Can you pls check this PR. It was approved earlier by Abhishek and has been updated.

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.

5 participants