[flex-counters] [202012] Delay flex counters stats init for faster boot time#1750
Closed
shlomibitton wants to merge 2 commits intosonic-net:202012from
shlomibitton:delay_flex_counters_202012
Closed
[flex-counters] [202012] Delay flex counters stats init for faster boot time#1750shlomibitton wants to merge 2 commits intosonic-net:202012from shlomibitton:delay_flex_counters_202012
shlomibitton wants to merge 2 commits intosonic-net:202012from
shlomibitton:delay_flex_counters_202012
Conversation
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
|
@tahmed-dev and @qiluo-msft we believe this can improve performance for any boot but specially for fastboot. |
Add flex counters unit-test Signed-off-by: Shlomi Bitton <shlomibi@nvidia.com>
Collaborator
|
@qiluo-msft kindly reminder. we need the fix merged in order to test fastboot and get some improvements. |
Contributor
|
Please update this PR according to the iterations in #1749 |
Contributor
|
Can we cleanly cherry-pick #1749? |
Contributor
Author
|
@qiluo-msft fixed the PR according to the comments on master. |
qiluo-msft
approved these changes
Jun 14, 2021
Contributor
|
Close this one because the master branch PR #1749 was reverted. |
EdenGri
pushed a commit
to EdenGri/sonic-swss
that referenced
this pull request
Feb 28, 2022
#### What I did Depends on [sonic-swss-common/pull/330](sonic-net/sonic-swss-common#330) According to [HLD](https://github.com/Azure/SONiC/blob/master/doc/rates-and-utilization/Rates_and_utilization_HLD.md) added calculation of rates and utilization columns to the `portstat` and `intfstat` scripts output #### How I did it Modified the `portstat` and `intfstat` scripts #### How to verify it Added UT #### Previous command output (if the output of a command-line utility has changed) ``` admin@sonic:~$ show int count IFACE STATE RX_OK RX_BPS RX_UTIL RX_ERR RX_DRP RX_OVR TX_OK TX_BPS TX_UTIL TX_ERR TX_DRP TX_OVR ----------- ------- ------- -------- --------- -------- -------- -------- ------- -------- --------- -------- -------- -------- Ethernet0 X 0 N/A N/A 0 0 N/A 0 N/A N/A 0 0 N/A Ethernet2 U 287 N/A N/A 0 0 N/A 818 N/A N/A 0 0 N/A Ethernet4 U 380 N/A N/A 0 0 N/A 858 N/A N/A 0 0 N/A Ethernet6 U 286 N/A N/A 0 0 N/A 850 N/A N/A 0 0 N/A ``` #### New command output (if the output of a command-line utility has changed) ``` admin@sonic:~$ show int count IFACE STATE RX_OK RX_BPS RX_UTIL RX_ERR RX_DRP RX_OVR TX_OK TX_BPS TX_UTIL TX_ERR TX_DRP TX_OVR ----------- ------- ------- ---------- --------- -------- -------- -------- ------- ---------- --------- -------- -------- -------- Ethernet0 X 0 0.00 B/s 0.00% 0 0 N/A 0 0.00 B/s 0.00% 0 0 N/A Ethernet2 U 0 0.00 B/s 0.00% 0 0 N/A 0 0.00 B/s 0.00% 0 0 N/A Ethernet4 U 0 0.00 B/s 0.00% 0 0 N/A 0 0.00 B/s 0.00% 0 0 N/A Ethernet6 U 0 0.00 B/s 0.00% 0 0 N/A 0 0.00 B/s 0.00% 0 0 N/A ```
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: Shlomi Bitton shlomibi@nvidia.com
What I did
Update flex counters DB with counters stats only when counters are enabled.
As long as the polling counters are not enabled, flex counters information will stored internally on PortsOrch.
Why I did it
Creating flex counters objects on the DB will trigger 'SYNCD' to access the HW for query statistics capabilities.
This HW access takes time and will be better to finish boot before doing this (mainly for fast-reboot but good to have in general).
The flex counters are not crucial at boot time, we can delay it to the end of the boot process.
How I verified it
Reboot a switch and observer the flex counters DB populated after counters are enabled.
Details if related