[action] [PR:526] [cmis] Optimize cmis.get_error_description speed for passive module#541
Merged
mssonicbld merged 1 commit intosonic-net:202405from Feb 12, 2025
Merged
Conversation
<!-- Provide a general summary of your changes in the Title above -->
#### Description
<!--
Describe your changes in detail
-->
cmis.get_error_description is very slow for passive module:
```
>>> begin = time.time()
>>> s.get_error_description()
'ModuleLowPwr'
>>> print(time.time() - begin)
2.905252695083618
```
For a module that has flat memory, it does not need check data path state. Because of this issue, `show error-status --fetch-from-hardware` takes very long time if there are many passive modules present:
```
real 1m12.116s
user 0m5.852s
sys 0m15.491s
```
After the fix, it changes to:
```
real 0m1.051s
user 0m0.499s
sys 0m0.059s
```
#### Motivation and Context
<!--
Why is this change required? What problem does it solve?
If this pull request closes/resolves an open Issue, make sure you
include the text "fixes #xxxx", "closes #xxxx" or "resolves #xxxx" here
-->
Optimize cmis.get_error_description for passive module
#### How Has This Been Tested?
<!--
Please describe in detail how you tested your changes.
Include details of your testing environment, and the tests you ran to
see how your change affects other areas of the code, etc.
-->
Manual test
Unit test
#### Additional Information (Optional)
Collaborator
Author
|
Original PR: #526 |
Collaborator
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@prgeor can you review this as well please? |
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.
Description
cmis.get_error_description is very slow for passive module:
For a module that has flat memory, it does not need check data path state. Because of this issue,
show error-status --fetch-from-hardwaretakes very long time if there are many passive modules present:After the fix, it changes to:
Motivation and Context
Optimize cmis.get_error_description for passive module
How Has This Been Tested?
Manual test
Unit test
Additional Information (Optional)