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

[voq] Add fabric counter cli commands #1860

Merged
merged 1 commit into from
Oct 17, 2022

Conversation

mlorrillere
Copy link
Contributor

Add fabric counters CLI commands.

Commands are:
show fabric counters port
show fabric counters port -n asic4
show fabric counters port -n asic5 -e
show fabric counters queue
show fabric counters queue -n asic4

Signed-off-by: Maxime Lorrillere mlorrillere@arista.com

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

# fabricstat -h
usage: fabricstat [-h] [-q] [-n NAMESPACE] [-e]

Display the fabric port state and counters

optional arguments:
  -h, --help            show this help message and exit
  -q, --queue           Display fabric queue stat, otherwise port stat
  -n NAMESPACE, --namespace NAMESPACE
                        Display fabric ports for specific namespace
  -e, --errors          Display errors

Examples:
    fabricstat
    fabricstat --namespace asic0
    fabricstat -p -n asic0 -e
    fabricstat -q
    fabricstat -q -n asic0
# show fabric counters -h
Usage: show fabric counters [OPTIONS] COMMAND [ARGS]...

  Show fabric port counters

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

Commands:
  port   Show fabric port stat
  queue  Show fabric queue stat
# show fabric counters port -h
Usage: show fabric counters port [OPTIONS]

  Show fabric port stat

Options:
  -d, --display [all|frontend]    Show internal interfaces  [default:
                                  frontend]
  -n, --namespace [asic0|asic1|asic2|asic3|asic4|asic5|asic6|asic7|asic8|asic9|asic10|asic11]
                                  Namespace name or all
  -e, --errors
  -h, -?, --help                  Show this message and exit.

Example output:

# show fabric counters port -n asic0
  ASIC    PORT    STATE    IN_CELL    IN_OCTET    OUT_CELL    OUT_OCTET    CRC    FEC_CORRECTABLE    FEC_UNCORRECTABLE    SYMBOL_ERR
------  ------  -------  ---------  ----------  ----------  -----------  -----  -----------------  -------------------  ------------
     0       0     down          0           0           0            0      0             206318           7949306448             0
     0       1     down          0           0           0            0      0                  0           7949048925             0
     0       2     down          0           0           0            0      0                  0           7948552578             0
     0       3     down          0           0           0            0      0                  0           7948049934             0
     0       4     down          0           0           0            0      0                  0           7947524845             0
     0       5     down          0           0           0            0      0                  0           7946976870             0
     0       6     down          0           0           0            0      0                  0           7946408318             0
     0       7     down          0           0           0            0      0                  0           7945775522             0
[...]
     0     187     down          0           0           0            0   3024         6887370202              3773897   11545823075
     0     188     down          0           0           0            0      0                  0          13130704211             0
     0     189     down          0           0           0            0      0             118941          13129730022             0
     0     190       up          0           0           0            0    514          162556197           2717957083          4823
     0     191     down          0           0           0            0      0                  0          13128089835             0

@lgtm-com
Copy link

lgtm-com bot commented Oct 6, 2021

This pull request introduces 4 alerts when merging b1a7aa9a9decd643905fc76fe3c0e8ac656473ca into 88baf3d - view on LGTM.com

new alerts:

  • 3 for Unused import
  • 1 for Syntax error

@lgtm-com
Copy link

lgtm-com bot commented Oct 6, 2021

This pull request introduces 7 alerts when merging 5c25eb1fc39333aa51318bd53f3ef22ee5f91461 into 88baf3d - view on LGTM.com

new alerts:

  • 6 for Unused import
  • 1 for Unused local variable

@mlorrillere
Copy link
Contributor Author

mlorrillere commented Oct 20, 2021

IN_CELL might not be required since we have IN_OCTET

@mlorrillere
Copy link
Contributor Author

Rename port to lane

@mlorrillere
Copy link
Contributor Author

Can we output a neighbor partner for a given link?

@rlhui
Copy link
Contributor

rlhui commented Oct 20, 2021

@skeesara-nokia, @vganesan-nokia - please help review, thanks

@rlhui rlhui requested review from arlakshm and abdosi October 20, 2021 17:29
Copy link
Contributor

@vganesan-nokia vganesan-nokia left a comment

Choose a reason for hiding this comment

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

Please address review comments

show/fabric.py Outdated Show resolved Hide resolved
scripts/fabricstat Outdated Show resolved Hide resolved
scripts/fabricstat Outdated Show resolved Hide resolved
scripts/fabricstat Show resolved Hide resolved
scripts/fabricstat Show resolved Hide resolved
scripts/fabricstat Outdated Show resolved Hide resolved
@mlorrillere mlorrillere force-pushed the pr-fabric-counters branch 2 times, most recently from 490acd4 to a53b193 Compare November 25, 2021 00:53
@lgtm-com
Copy link

lgtm-com bot commented Nov 25, 2021

This pull request introduces 9 alerts when merging a53b193ab9917286fe918c6f51dc7ccf0be5ae80 into c05845d - view on LGTM.com

new alerts:

  • 8 for Unused import
  • 1 for Unused local variable

@lgtm-com
Copy link

lgtm-com bot commented Nov 25, 2021

This pull request introduces 9 alerts when merging c8cc5c78c9aaef24e7fe087894e99ed04937a59a into c05845d - view on LGTM.com

new alerts:

  • 8 for Unused import
  • 1 for Unused local variable

@arlakshm
Copy link
Contributor

This pull request introduces 9 alerts when merging c8cc5c7 into c05845d - view on LGTM.com

new alerts:

  • 8 for Unused import
  • 1 for Unused local variable

@mlorrillere can you fix the lgtm alerts?

1 similar comment
@arlakshm
Copy link
Contributor

This pull request introduces 9 alerts when merging c8cc5c7 into c05845d - view on LGTM.com

new alerts:

  • 8 for Unused import
  • 1 for Unused local variable

@mlorrillere can you fix the lgtm alerts?

@mlorrillere
Copy link
Contributor Author

This pull request introduces 9 alerts when merging c8cc5c7 into c05845d - view on LGTM.com
new alerts:

  • 8 for Unused import
  • 1 for Unused local variable

@mlorrillere can you fix the lgtm alerts?

My bad, I had the changes ready and forgot to commit. Should be fixed now.

@arlakshm
Copy link
Contributor

arlakshm commented May 4, 2022

Hi @mlorrillere, the unit tests added for the fabric counter, tests/fabricstat_test.py, are failing.
I think the reason they are failing is because the tests are trying to connect to the actual redis instance iso for mock db.
the script fabricstat the mock db must if the UTILITIES_UNIT_TESTING enivornment variable is set.

Please refer to this block as an example https://github.com/Azure/sonic-utilities/blob/master/scripts/intfutil#L15-L28

@mlorrillere mlorrillere force-pushed the pr-fabric-counters branch 5 times, most recently from 4863631 to 38a3d50 Compare June 21, 2022 18:28
@mlorrillere
Copy link
Contributor Author

Hi @arlakshm

I've addressed the remaining issues and all checks passed.

Signed-off-by: Maxime Lorrillere <mlorrillere@arista.com>
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Aug 2, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: mlorrillere / name: Maxime Lorrillere (98b3c2a)

@mlorrillere
Copy link
Contributor Author

/easycla

@arlakshm
Copy link
Contributor

/Azp run Azure.sonic-utilities

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@kenneth-arista
Copy link
Contributor

@arlakshm since everything is approved, can you merge this PR?

@arlakshm arlakshm merged commit 25fda26 into sonic-net:master Oct 17, 2022
mdanish-kh pushed a commit to hamnarauf/sonic-utilities that referenced this pull request Oct 22, 2022
Add fabric counters CLI commands.

Commands are:
show fabric counters port
show fabric counters port -n asic4
show fabric counters port -n asic5 -e
show fabric counters queue
show fabric counters queue -n asic4

Signed-off-by: Maxime Lorrillere <mlorrillere@arista.com>
yxieca pushed a commit that referenced this pull request Oct 25, 2022
Add fabric counters CLI commands.

Commands are:
show fabric counters port
show fabric counters port -n asic4
show fabric counters port -n asic5 -e
show fabric counters queue
show fabric counters queue -n asic4

Signed-off-by: Maxime Lorrillere <mlorrillere@arista.com>
preetham-singh pushed a commit to preetham-singh/sonic-utilities that referenced this pull request Nov 21, 2022
Add fabric counters CLI commands.

Commands are:
show fabric counters port
show fabric counters port -n asic4
show fabric counters port -n asic5 -e
show fabric counters queue
show fabric counters queue -n asic4

Signed-off-by: Maxime Lorrillere <mlorrillere@arista.com>
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.

6 participants