[show] add support for muxcable metrics - #1615
Merged
Merged
Conversation
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
jleveque
suggested changes
May 17, 2021
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
jleveque
previously approved these changes
May 17, 2021
tahmed-dev
reviewed
May 17, 2021
| "non_fatal|UnxCmplt": "0" | ||
| }, | ||
| "MUX_METRICS_TABLE|Ethernet0": { | ||
| "linkmgrd_switch_active_start": "2021-May-13 10:00:21.420898", |
Contributor
There was a problem hiding this comment.
is it possible the same date format as does linkmgrd, yyyy-mmm-dd?
Contributor
Author
There was a problem hiding this comment.
It's actually taken care in the xcvrd now, this version was running on old xcvrd changes, I will update the comment and testcases.
`admin@STR43-0101-0101-01LT0:~$ redis-cli -n 6 hgetall "MUX_METRICS_TABLE|Ethernet0"
- "linkmgrd_switch_active_start"
- "2021-May-13 10:00:21.420898"
- "linkmgrd_switch_unknown_end"
- "2021-May-13 10:00:26.123319"
- "xcvrd_switch_standby_start"
- "2021-May-17 18:15:11.057528"
- "xcvrd_switch_standby_end"
- "2021-May-17 18:15:11.062379"
- "linkmgrd_switch_standby_end"
- "2021-May-17 18:15:11.062887"`
tahmed-dev
previously approved these changes
May 17, 2021
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
tahmed-dev
approved these changes
May 20, 2021
yxieca
pushed a commit
that referenced
this pull request
May 27, 2021
* [show] add support for muxcable metrics
What I did
Added support for show muxcable metrics. This essentially records what events came to different modules per se
for toggling the mux from one state to another.
for example
admin@sonic$ show muxcable metrics Ethernet0 --json
{
"linkmgrd_switch_active_start": "2021-May-13 10:00:21.420898",
"linkmgrd_switch_standby_end": "2021-May-13 10:01:15.696728",
"linkmgrd_switch_unknown_end": "2021-May-13 10:00:26.123319",
"xcvrd_switch_standby_end": "2021-May-13 10:01:15.696051",
"xcvrd_switch_standby_start": "2021-May-13 10:01:15.690835"
}
or
admin@sonic:$ show muxcable metrics Ethernet0
PORT EVENT TIME
--------- ---------------------------- ---------------------------
Ethernet0 linkmgrd_switch_active_start 2021-May-13 10:00:21.420898
Ethernet0 linkmgrd_switch_standby_end 2021-May-13 10:01:15.696728
Ethernet0 linkmgrd_switch_unknown_end 2021-May-13 10:00:26.123319
Ethernet0 xcvrd_switch_standby_end 2021-May-13 10:01:15.696051
Ethernet0 xcvrd_switch_standby_start 2021-May-13 10:01:15.690835
How I did it
added changes in show/muxcable.py by reading and publishing the state DB contents for the corresponding table
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
gitsabari
pushed a commit
to gitsabari/sonic-utilities
that referenced
this pull request
Jun 15, 2021
* [show] add support for muxcable metrics
What I did
Added support for show muxcable metrics. This essentially records what events came to different modules per se
for toggling the mux from one state to another.
for example
admin@sonic$ show muxcable metrics Ethernet0 --json
{
"linkmgrd_switch_active_start": "2021-May-13 10:00:21.420898",
"linkmgrd_switch_standby_end": "2021-May-13 10:01:15.696728",
"linkmgrd_switch_unknown_end": "2021-May-13 10:00:26.123319",
"xcvrd_switch_standby_end": "2021-May-13 10:01:15.696051",
"xcvrd_switch_standby_start": "2021-May-13 10:01:15.690835"
}
or
admin@sonic:$ show muxcable metrics Ethernet0
PORT EVENT TIME
--------- ---------------------------- ---------------------------
Ethernet0 linkmgrd_switch_active_start 2021-May-13 10:00:21.420898
Ethernet0 linkmgrd_switch_standby_end 2021-May-13 10:01:15.696728
Ethernet0 linkmgrd_switch_unknown_end 2021-May-13 10:00:26.123319
Ethernet0 xcvrd_switch_standby_end 2021-May-13 10:01:15.696051
Ethernet0 xcvrd_switch_standby_start 2021-May-13 10:01:15.690835
How I did it
added changes in show/muxcable.py by reading and publishing the state DB contents for the corresponding table
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
raphaelt-nvidia
pushed a commit
to raphaelt-nvidia/sonic-utilities
that referenced
this pull request
Aug 10, 2021
* [show] add support for muxcable metrics
What I did
Added support for show muxcable metrics. This essentially records what events came to different modules per se
for toggling the mux from one state to another.
for example
admin@sonic$ show muxcable metrics Ethernet0 --json
{
"linkmgrd_switch_active_start": "2021-May-13 10:00:21.420898",
"linkmgrd_switch_standby_end": "2021-May-13 10:01:15.696728",
"linkmgrd_switch_unknown_end": "2021-May-13 10:00:26.123319",
"xcvrd_switch_standby_end": "2021-May-13 10:01:15.696051",
"xcvrd_switch_standby_start": "2021-May-13 10:01:15.690835"
}
or
admin@sonic:$ show muxcable metrics Ethernet0
PORT EVENT TIME
--------- ---------------------------- ---------------------------
Ethernet0 linkmgrd_switch_active_start 2021-May-13 10:00:21.420898
Ethernet0 linkmgrd_switch_standby_end 2021-May-13 10:01:15.696728
Ethernet0 linkmgrd_switch_unknown_end 2021-May-13 10:00:26.123319
Ethernet0 xcvrd_switch_standby_end 2021-May-13 10:01:15.696051
Ethernet0 xcvrd_switch_standby_start 2021-May-13 10:01:15.690835
How I did it
added changes in show/muxcable.py by reading and publishing the state DB contents for the corresponding table
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
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.
Signed-off-by: vaibhav-dahiya vdahiya@microsoft.com
What I did
Added support for show muxcable metrics. This essentially records what events came to different modules per se
for toggling the mux from one state to another.
for example
admin@sonic$ show muxcable metrics Ethernet0 --json{"linkmgrd_switch_active_start": "2021-May-13 10:00:21.420898","linkmgrd_switch_standby_end": "2021-May-13 10:01:15.696728","linkmgrd_switch_unknown_end": "2021-May-13 10:00:26.123319","xcvrd_switch_standby_end": "2021-May-13 10:01:15.696051","xcvrd_switch_standby_start": "2021-May-13 10:01:15.690835"}or
admin@sonic:$ show muxcable metrics Ethernet0PORT EVENT TIME--------- ---------------------------- ---------------------------Ethernet0 linkmgrd_switch_active_start 2021-May-13 10:00:21.420898Ethernet0 linkmgrd_switch_standby_end 2021-May-13 10:01:15.696728Ethernet0 linkmgrd_switch_unknown_end 2021-May-13 10:00:26.123319Ethernet0 xcvrd_switch_standby_end 2021-May-13 10:01:15.696051Ethernet0 xcvrd_switch_standby_start 2021-May-13 10:01:15.690835How I did it
added changes in show/muxcable.py by reading and publishing the state DB contents for the corresponding table
How to verify it
unit tests are added for verifying.
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)