-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Support for Memory Statisticsd Process and Configurations #20355
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
Open
Arham-Nasir
wants to merge
27
commits into
sonic-net:master
Choose a base branch
from
Arham-Nasir:feature/memory-statistics-daemon-process
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
4b20cb2
Added Memory Statistics Daemon to collect, store, and manage memory u…
Arham-Nasir 03d0650
Merge branch 'sonic-net:master' into feature/memory-statistics-daemon…
Arham-Nasir 27a31e1
Add SyslogLogger class for syslog message logging
Arham-Nasir 6569ac7
Merge branch 'feature/memory-statistics-daemon-process' of github.com…
Arham-Nasir 4ef28ef
Added Dict2Obj for dict-object conversion and Utility class for date …
Arham-Nasir 08cddde
Added TimeProcessor class to handle time validation, date parsing, an…
Arham-Nasir b886d0f
Add MemoryReportGenerator class for generating formatted memory stati…
Arham-Nasir 565201e
Add MemoryEntryManager class for managing and formatting memory entries
Arham-Nasir f068c78
Add SocketHandler class for UNIX socket communication
Arham-Nasir 2b01214
Adjusting the recomemnded file permission for unix socket
Arham-Nasir d7f3fb9
Added the MemoryStatisticsService, Daemonizer,MemoryStatisticsProcess…
Arham-Nasir 4f84986
update the memory_statistics handler file
Arham-Nasir e96bb24
Improved the config_db functionality to handle validation more gracef…
Arham-Nasir 8478b8a
Resolved issues to improve reliability
Arham-Nasir 86d7713
Enhance Daemonizer with robust validation
Arham-Nasir f8f960c
Update memory statistics collection and retention logic
Arham-Nasir e5634d9
Replace pickle with JSON for secure serialization
Arham-Nasir e014037
Refactored error handling and validation for robustness
Arham-Nasir c28cebd
update memory_statistics code
Arham-Nasir 7f95411
Add memory statistics service setup
Arham-Nasir 935f6da
Pulled Changes from the Remote Master BuildImage
Arham-Nasir b9f31ea
updated the mem-stats code
Arham-Nasir 5e994d9
remove the all the generic exceptions and update code
Arham-Nasir 3f9667e
update the memstats file
Arham-Nasir cf7649e
Merge branch 'master' of github.com:Arham-Nasir/sonic-buildimage into…
Arham-Nasir 56ed56e
update mem-stats
Arham-Nasir 7a31207
update memory statistics service file
Arham-Nasir File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
11 changes: 11 additions & 0 deletions
11
files/image_config/memory_statistics/memory_statistics.conf
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # Memory Statistics Daemon Configuration | ||
| [default] | ||
|
|
||
| # Enable or disable memory statistics collection | ||
| enabled=false | ||
|
|
||
| # Interval for memory data collection (in minutes) | ||
| sampling_interval=5 | ||
|
|
||
| # Duration for which memory data is retained (in days) | ||
| retention_period=15 | ||
13 changes: 13 additions & 0 deletions
13
files/image_config/memory_statistics/memory_statistics.service
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| [Unit] | ||
| Description=Memory Statistics Daemon | ||
| After=network.target redis.service | ||
| Requires=redis.service | ||
|
|
||
| [Service] | ||
| ExecStart=/usr/bin/memory_statistics_service.py | ||
| Restart=on-failure | ||
| RestartSec=5 | ||
| EnvironmentFile=-/etc/memory_statistics/memory_statistics.conf | ||
|
|
||
| [Install] | ||
| WantedBy=multi-user.target |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it better if these configurations can put into config db instead of a static conf file? #Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have stored configurations in both config_db and a static conf file for flexibility and reliability.
At startup, the daemon reads default settings from the conf file to ensure a consistent state after a restart. During runtime, the daemon dynamically updates its configuration from config_db without needing a restart. This approach combines the stability of predefined defaults with the convenience of live updates, ensuring predictable behavior and seamless adaptability.