Skip to content

[action] [PR:526] [cmis] Optimize cmis.get_error_description speed for passive module#541

Merged
mssonicbld merged 1 commit intosonic-net:202405from
mssonicbld:cherry/202405/526
Feb 12, 2025
Merged

[action] [PR:526] [cmis] Optimize cmis.get_error_description speed for passive module#541
mssonicbld merged 1 commit intosonic-net:202405from
mssonicbld:cherry/202405/526

Conversation

@mssonicbld
Copy link
Copy Markdown
Collaborator

Description

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

Optimize cmis.get_error_description for passive module

How Has This Been Tested?

Manual test
Unit test

Additional Information (Optional)

<!-- 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)
@mssonicbld
Copy link
Copy Markdown
Collaborator Author

Original PR: #526

@mssonicbld
Copy link
Copy Markdown
Collaborator Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@arfeigin
Copy link
Copy Markdown

@prgeor can you review this as well please?

@mssonicbld mssonicbld merged commit fec0ad0 into sonic-net:202405 Feb 12, 2025
5 checks passed
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.

2 participants