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

[202205] [sonic_py_common] Cache Static Information in device_info to speed up CLI response #11866

Merged
merged 2 commits into from
Aug 29, 2022

Conversation

vivekrnv
Copy link
Contributor

Why I did it

Backport #11696 to 202205, since direct cherry-pick is causing build failure

How I did it

How to verify it

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

vivekrnv and others added 2 commits August 29, 2022 02:24
… CLI response (sonic-net#11696)

- Why I did it
Profiled the execution for the following cmd intfutil -c status

- How I did it
Cached the following information:
1. get_sonic_version_info()
2. get_platform_info()
None of the API exposed to the user libraries (for eg: sonic-utilities) has been modified
These methods involve reading text files or from redis. Thus, caching helped to improve the execution time

- How to verify it
Added UT's.
Verified on the device

Signed-off-by: Vivek Reddy Karri <vkarri@nvidia.com>
Signed-off-by: Vivek Reddy <vkarri@nvidia.com>
@yxieca yxieca merged commit 4910298 into sonic-net:202205 Aug 29, 2022
@vivekrnv
Copy link
Contributor Author

@yxieca, Can this be backported to 202111 as well?

lukasstockner pushed a commit to genesiscloud/sonic-buildimage that referenced this pull request Apr 9, 2023
… speed up CLI response (sonic-net#11866)

* [sonic_py_common] Cache Static Information in device_info to speed up CLI response (sonic-net#11696)

- Why I did it
Profiled the execution for the following cmd intfutil -c status

- How I did it
Cached the following information:
1. get_sonic_version_info()
2. get_platform_info()
None of the API exposed to the user libraries (for eg: sonic-utilities) has been modified
These methods involve reading text files or from redis. Thus, caching helped to improve the execution time

- How to verify it
Added UT's.
Verified on the device

Signed-off-by: Vivek Reddy Karri <vkarri@nvidia.com>

* Removed UT since libswsscommom dep is missing in <=202205

Signed-off-by: Vivek Reddy <vkarri@nvidia.com>

Signed-off-by: Vivek Reddy Karri <vkarri@nvidia.com>
Signed-off-by: Vivek Reddy <vkarri@nvidia.com>
@vivekrnv vivekrnv deleted the device_info_cache_2205 branch September 19, 2023 04:24
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