+
+
+ Figure 5: Sequence diagram for displaying the current memory statistics configuration in ConfigDB using the CLI
+
+## SAI API
+
+No SAI API change or addition is needed for this HLD.
+
+## Configuration and Management
+
+### CLI/YANG Model Enhancements
+
+#### CLI Commands
+
+**Set the Frequency of Memory Data Collection**
+
+To configure the interval for memory data collection, use the following command:
+
+ admin@sonic:~$ config memory-stats sampling-interval
+
+**Adjust the Data Retention Period**
+
+To set how long the memory data should be retained, use the following command:
+
+ admin@sonic:~$ config memory-stats retention-period
+
+**Enable/Disable Memory Statistics Monitoring**
+
+To enable or disable the memory statistics monitoring feature, use the following command:
+
+ admin@sonic:~$ config memory-stats enable/disable
+
+**View Memory Usage**
+
+To display basic or detailed memory usage statistics, use the following command with optional parameters for time range and specific metrics:
+
+ admin@sonic:~$ show memory-stats [--detail] [--from ] [--to ] [--select ]
+
+**Command Definition**
+- **show memory-stats:** Display basic memory usage statistics.
+ - **--detail:** Display detailed memory usage statistics.
+ - **--from :** Display memory statistics from the specified start date-time.
+ - **--to :** Display memory statistics up to the specified end date-time.
+ - **--select :** Display specific memory statistics, such as total memory.
+
+ **Sample Output for Memory Usage**
+
+Below is an example of the Memory Statistics output as it appears in the CLI. This display provides a summary of system memory metrics over a default time period, ideal for routine monitoring and analysis:
+
+ sonic:~$ show memory-stats
+
+ Codes: M - minutes, H - hours, D - days
+ --------------------------------------------------------------------------------
+ Report Generated: 2024-06-15 09:00:00
+ Analysis Period: From 2024-06-01 09:00:00 to 2024-06-15 09:00:00
+ Interval: Bi-daily
+ --------------------------------------------------------------------------------
+ Metric Current High Low D1-D2 D3-D4 D5-D6 D7-D8 D9-D10 D11-D12 D13-D14 D15
+ Value Value Value 01Jun24 03Jun24 05Jun24 07Jun24 09Jun24 11Jun24 13Jun24 15Jun24
+ -------------- -------- -------- -------- --------- --------- --------- --------- --------- --------- --------- ---------
+ Total Memory 15.6G 15.6G 15.1G 15.1G 15.2G 15.3G 15.3G 15.4G 15.5G 15.5G 15.6G
+ Used Memory 2.3G 2.5G 2.0G 2.1G 2.2G 2.2G 2.3G 2.4G 2.3G 2.2G 2.3G
+ Free Memory 11.9G 12.4G 10.6G 11.0G 11.2G 11.4G 11.5G 11.7G 11.8G 11.9G 12.0G
+ Available Memory 13.0G 14.3G 12.4G 12.6G 12.7G 12.8G 12.9G 13.0G 13.1G 13.2G 13.3G
+
+**View Memory Statistics Configuration**
+
+To display the current configuration parameters data collection frequency, retention period, and enable/disable status in the MEMORY_STATS_TABLE, use the following command:
+
+ admin@sonic:~$ show memory-stats config
+
+**Sample Output for Memory Statistics Configuration**
+
+Below is an example of the Memory Statistics Configuration output as it appears in the CLI. This display provides a snapshot of the current configuration settings for memory statistics monitoring in confgdb:
+
+ sonic:~$ show memory-stats config
+
+ Memory Statistics Configuration:
+ --------------------------------
+ Enabled: true
+ Sampling Interval: 5 minutes
+ Retention Period: 15 days
+
+ #### YANG Model Enhancements
+
+A new YANG Model for sonic-memory-stats will be added.
+
+```
+module memory-stats {
+ yang-version 1.1;
+
+ namespace "http://github.com/sonic-net/sonic-memory-stats";
+ prefix mem;
+
+ import sonic-types {
+ prefix stypes;
+ }
+
+ description "Memory-Stats YANG Module for SONiC-based OS";
+ revision 2024-07-22 {
+ description "First Revision";
+ }
+
+ container MemoryStats {
+ description "Memory statistics configuration";
+
+ leaf enabled {
+ type boolean;
+ default true;
+ description "Enable or disable memory statistics";
+ }
+
+ leaf sampling-interval {
+ type uint16;
+ units "minutes"";
+ description "Interval for sampling memory statistics";
+ }
+
+ leaf retention-period {
+ type uint16;
+ units "days";
+ description "Retention period for memory statistics data";
+ }
+ }
+
+ ```
+
+### Config DB Enhancements
+
+A new table, `MEMORY_STATS_TABLE`, will be introduced in `ConfigDB` to store the configuration settings of the Memory Statistics feature. This table will allow for management of data collection frequency, retention period, and enable/disable status. The relevant configuration parameters and the schema for this table are detailed below.
+
+**MEMORY_STATS Configuration Parameters**
+
+| Parameter | Type | Description |
+|---------------------|-------------|----------------------------------------------------------------|
+| enabled | boolean | Enable or disable memory statistics collection. |
+| sampling_interval | unit16 | Interval for memory data collection. |
+| retention_period | unit16 | Duration for which memory data is retained. |
+
+**Config DB Schema**
+```json
+
+MEMORY_STATS_TABLE: {
+ "MemoryStats": {
+ "enabled": "true",
+ "sampling_interval": "5",
+ "retention_period": "15"
+ }
+}
+```
+
+### Configuration File for Memory Statistics Daemon
+
+A configuration file will be created to store the settings for the `memorystatsd` daemon. This file will be read by the daemon to determine its operating parameters, such as the sampling interval and data retention period.
+
+**Example Configuration File**
+
+```
+# Memory Statistics Daemon Configuration
+
+# Enable or disable memory statistics collection
+enabled=true
+
+# Interval for memory data collection
+sampling_interval=5
+
+# Duration for which memory data is retained
+retention_period=15
+```
+**Daemon Configuration Management**
+
+The `memorystatsd` daemon will read its configuration from the configuration file. The daemon and its manager, `memstatsmgrd`, will be designed to:
+
+- **Read Configuration at Startup:** On startup, `memorystatsd` will read the configuration file to get the initial settings.
+- **Monitor ConfigDB for Changes:** `memstatsmgrd` will watch the `MEMORY_STATS_TABLE` in ConfigDB for any configuration changes.
+- **Update Configuration File:** When configurations are updated via CLI, `memstatsmgrd` will update the configuration file based on changes detected in ConfigDB.
+- **Restart to Apply Changes:** `memstatsmgrd` will restart the `memorystatsd` service to apply the new settings if necessary.
+
+**Workflow for Configuration Management**
+
+1. **Initial Setup:** On deployment, default settings are written to both ConfigDB and the configuration file.
+2. **Daemon Startup:** `memorystatsd` reads the configuration file to initialize its parameters.
+3. **Runtime Configuration Changes:** Administrators update settings via CLI, which writes changes to ConfigDB.
+4. **Monitor ConfigDB for Changes:** `memstatsmgrd` detects these changes in ConfigDB.
+5. **Update Configuration File:** `memstatsmgrd` updates the configuration file to reflect the new settings.
+6. **Restart Daemon:** `memstatsmgrd` restarts the `memorystatsd` service to apply the new settings.
+
+## Warmboot and Fastboot Design Impact
+
+There is no impact on warmboot/fastboot functionalities by this HLD.
+
+## Testing Requirements/Design
+
+### Unit Test Cases
+
+| Test Case ID | Test Case Description |
+|--------------|----------------------------------------------------------------------------------------------|
+| UT1 | Verify CLI to show default memory statistics for the last 15 days |
+| UT2 | Verify CLI to show detailed memory statistics with the --detail option |
+| UT3 | Verify CLI to show memory data for a custom time range using --from and --to options |
+| UT4 | Verify CLI to show selective memory metrics using the --select option |
+| UT5 | Verify CLI for error handling with incorrect syntax or invalid parameters |
+| UT6 | Verify CLI to reject future dates in --from or --to options |
+| UT7 | Verify CLI to reject cases where --from date is later than --to date |
+| UT8 | Verify CLI to configure memory data collection frequency using config memory-stats sampling-interval |
+| UT9 | Verify CLI to configure memory data retention period using config memory-stats retention-period |
+| UT10 | Verify CLI to enable memory statistics monitoring using config memory-stats enable |
+| UT11 | Verify CLI to disable memory statistics monitoring using config memory-stats disable |
+
+### System Test Cases
+
+| Test Case ID | Test Case Description |
+|--------------|------------------------------------------------------------------------------------------------------------|
+| ST1 | Validate the end-to-end functionality of the memory statistics daemon, ensuring proper configuration reading, restart on update, data collection, and data retention |
+
+## Future Work
+
+- Implement an alert system to notify administrators of significant memory usage anomalies or thresholds to enhance proactive maintenance capabilities.
+- Expand the feature to collect additional memory metrics.
From ec2ce4c2cdd1872bbbca2d4021ac4c64923f2503 Mon Sep 17 00:00:00 2001
From: kanza-latif
Date: Mon, 19 Aug 2024 13:25:50 +0500
Subject: [PATCH 02/14] Update memory_statistics_hld.md
---
.../memory_statistics_hld.md | 109 ++++++++----------
1 file changed, 47 insertions(+), 62 deletions(-)
diff --git a/doc/memory_statistics/memory_statistics_hld.md b/doc/memory_statistics/memory_statistics_hld.md
index 2141659702..b7f75f9b49 100644
--- a/doc/memory_statistics/memory_statistics_hld.md
+++ b/doc/memory_statistics/memory_statistics_hld.md
@@ -29,7 +29,6 @@
- [CLI Commands](#cli-commands)
- [YANG Model Enhancements](#yang-model-enhancements)
- [Config DB Enhancements](#config-db-enhancements)
- - [Configuration File for Memory Statistics Daemon](#configuration-file-for-memory-statistics-daemon)
- [Warmboot and Fastboot Design Impact](#warmboot-and-fastboot-design-impact)
- [Testing Requirements/Design](#testing-requirementsdesign)
- [Unit Test Cases](#unit-test-cases)
@@ -40,7 +39,7 @@
| Version | Date | Description | Author |
|---------|------------|---------------------------------------------------|-------------------------|
-| 1.0 | 2024-07-22 | Initial version | Arham Nasir |
+| 1.0 | 2024-07-22 | Initial version | Arham Nasir, Kanza Latif|
## Scope
@@ -74,9 +73,9 @@ This section explains how Memory Statistics feature works, focusing on user cont
### Feature Overview
-- **Feature Scope:** Memory Statistics feature offers a systematic approach to monitoring system-wide memory usage. It automatically records crucial metrics such as Total Memory, Used Memory, Free Memory, and Available Memory. For those requiring more in-depth analysis, additional metrics like Active Memory, Inactive Memory, and others are accessible via extended command options, providing a more detailed view.
-- **Configurability:** This feature offers customizable options for data collection frequency and the duration of data retention according to their specific operational needs. By default, the system is configured to collect memory data every 5 minutes and retains this information for 15 days, ensuring a balance between granularity and storage management.
-- **Enable/Disable Functionality:** This feature is enabled by default to ensure continuous monitoring but can be easily disabled to conserve system resources, suiting various administrative preferences.
+- **Feature Scope:** Memory Statistics feature offers a systematic approach to monitoring system-wide memory usage. It automatically records crucial metrics such as Total Memory, Used Memory, Free Memory, Available Memory, Cached Memory, Shared Memory and Buffers.
+- **Configurability:** This feature offers customizable options for data collection frequency and the duration of data retention according to their specific operational needs. By default, the system is configured to collect memory at all times and sample it every 5 minutes and retains this information for 15 days , ensuring a balance between granularity and storage management.
+- **Enable/Disable Functionality:** This feature is disabled by default to conserve system resources , suiting various administrative preferences but can be easily enabled to ensure continuous monitoring.
### Feature Specification
@@ -90,9 +89,9 @@ Memory Statistics utilizes a dedicated systemd process for the periodic collecti
User interaction with the Memory Statistics feature is designed to be straightforward and efficient, utilizing a set of powerful CLI commands that enable administrators to manage and analyze memory data effectively.The CLI interface includes commands for:
- **Viewing Memory Statistics:** Users can view memory data over custom time intervals with `--from` and `--to` options for defining the start and end times. This allows for flexible and targeted data analysis.
- - **Default Memory Overview:** For a quick general overview without specific parameters, the default command displays system memory statistics covering the last 15 days. This will provides a summary of crucial metrics such as Total Memory, Used Memory, Free Memory, and Available Memory, ideal for routine checks.
+ - **Default Memory Overview:** For a quick general overview without specific parameters, the default command displays system memory statistics covering the last 15 days. This will provide a summary of crucial metrics such as Total Memory, Used Memory, Free Memory, Available Memory, Cached Memory, Shared Memory and Buffers, ideal for routine checks.
- **Selecting Specific Memory Metrics:** This feature enables users to choose specific memory metrics to display, such as Total Memory or Free Memory, which helps in focusing on relevant data points and reducing output clutter.
-- **Configuring Data Collection and Retention:** Administrators can adjust the frequency of data collection and the duration of data retention through commands and can specify how long to retain the collected data.
+- **Configuring Data Collection and Retention:** Administrators can adjust the frequency of data collection and the duration of data retention through commands and can specify how long to retain the collected data for.
- **Enabling/Disabling the Feature:** To adapt to different operational requirements, users can enable or disable the Memory Statistics feature as needed.
### Functional Requirements
@@ -104,19 +103,19 @@ User interaction with the Memory Statistics feature is designed to be straightfo
The overall SONiC architecture will remain the same. However, the following updates and additions will be implemented:
-- **New Daemon Process:**
- - **memorystatsd:** A new systemd daemon process that will be implemented to gather and log memory statistics, utilizing configuration settings read from a designated configuration file.
- - **memstatsmgrd:** A new manager daemon that will monitor changes in the ConfigDB's `MEMORY_STATS_TABLE` and update the memorystats configuration file accordingly. `memstatsmgrd` will restart the `memorystatsd` service to apply the new settings.
+- **Daemon Process:**
+ - **memorystatsd:** A new system daemon process that will be implemented to gather and log memory statistics.
+ - **hostcfgd:** The existing host config daemon will monitor changes in the ConfigDB's `MEMORY_STATISTICS_TABLE` and will reload the `memorystatsd` service to apply the new settings.
- **Log File Directories:** Supporting log file directories will be established via SONiC Buildimage.
-- **SONiC Utilities Updates:** Changes will be made in the SONiC Utilities container to add new "show" commands for displaying memory statistics and "config" commands.
-- **New Configuration Table:** A new table, MEMORY_STATS_TABLE, will be added to ConfigDB to store memory-stats configuration parameters.
+- **SONiC Utilities Updates:** Changes will be made in the SONiC Utilities container to add new "show" and "config" commands.
+- **New Configuration Table:** A new table, MEMORY_STATISTICS_TABLE, will be added to ConfigDB to store memory-stats configuration parameters.
The high-level feature design diagram is shown below.
- Figure 1: Feature architecture diagram showing the unix socket, daemon, ConfigDB, Config File and data file
+ Figure 1: Feature architecture diagram showing the unix socket, daemon, ConfigDB and data file
### Sequence Diagram
@@ -175,28 +174,30 @@ No SAI API change or addition is needed for this HLD.
To configure the interval for memory data collection, use the following command:
admin@sonic:~$ config memory-stats sampling-interval
+ Default sampling-interval is 5 minutes
**Adjust the Data Retention Period**
To set how long the memory data should be retained, use the following command:
admin@sonic:~$ config memory-stats retention-period
+ Default retention-period is 15 days
**Enable/Disable Memory Statistics Monitoring**
To enable or disable the memory statistics monitoring feature, use the following command:
admin@sonic:~$ config memory-stats enable/disable
+ By default, it is disabled.
**View Memory Usage**
-To display basic or detailed memory usage statistics, use the following command with optional parameters for time range and specific metrics:
+To display memory usage statistics, use the following command with optional parameters for time range and specific metrics:
- admin@sonic:~$ show memory-stats [--detail] [--from ] [--to ] [--select ]
+ admin@sonic:~$ show memory-stats [--from ] [--to ] [--select ]
**Command Definition**
-- **show memory-stats:** Display basic memory usage statistics.
- - **--detail:** Display detailed memory usage statistics.
+ - **show memory-stats:** Display basic memory usage statistics
- **--from :** Display memory statistics from the specified start date-time.
- **--to :** Display memory statistics up to the specified end date-time.
- **--select :** Display specific memory statistics, such as total memory.
@@ -220,10 +221,13 @@ Below is an example of the Memory Statistics output as it appears in the CLI. Th
Used Memory 2.3G 2.5G 2.0G 2.1G 2.2G 2.2G 2.3G 2.4G 2.3G 2.2G 2.3G
Free Memory 11.9G 12.4G 10.6G 11.0G 11.2G 11.4G 11.5G 11.7G 11.8G 11.9G 12.0G
Available Memory 13.0G 14.3G 12.4G 12.6G 12.7G 12.8G 12.9G 13.0G 13.1G 13.2G 13.3G
+ Cached Memory
+ Buffer Memory
+ Shared Memory
**View Memory Statistics Configuration**
-To display the current configuration parameters data collection frequency, retention period, and enable/disable status in the MEMORY_STATS_TABLE, use the following command:
+To display the current configuration parameters such as data collection frequency, retention period, and enable/disable status in the MEMORY_STATISTICS_TABLE, use the following command:
admin@sonic:~$ show memory-stats config
@@ -264,13 +268,13 @@ module memory-stats {
leaf enabled {
type boolean;
- default true;
+ default false;
description "Enable or disable memory statistics";
}
leaf sampling-interval {
type uint16;
- units "minutes"";
+ units "minutes";
description "Interval for sampling memory statistics";
}
@@ -285,7 +289,7 @@ module memory-stats {
### Config DB Enhancements
-A new table, `MEMORY_STATS_TABLE`, will be introduced in `ConfigDB` to store the configuration settings of the Memory Statistics feature. This table will allow for management of data collection frequency, retention period, and enable/disable status. The relevant configuration parameters and the schema for this table are detailed below.
+A new table, `MEMORY_STATISTICS_TABLE`, will be introduced in `ConfigDB` to store the configuration settings of the Memory Statistics feature. This table will allow for management of data collection frequency, retention period, and enable/disable status. The relevant configuration parameters and the schema for this table are detailed below.
**MEMORY_STATS Configuration Parameters**
@@ -307,41 +311,23 @@ MEMORY_STATS_TABLE: {
}
```
-### Configuration File for Memory Statistics Daemon
+6. **Daemon Configuration Management**
-A configuration file will be created to store the settings for the `memorystatsd` daemon. This file will be read by the daemon to determine its operating parameters, such as the sampling interval and data retention period.
+The `memorystatsd` will dynamically manage its configuration using the `hostcfgd`. The design will:
-**Example Configuration File**
-
-```
-# Memory Statistics Daemon Configuration
-
-# Enable or disable memory statistics collection
-enabled=true
-
-# Interval for memory data collection
-sampling_interval=5
-
-# Duration for which memory data is retained
-retention_period=15
-```
-**Daemon Configuration Management**
-
-The `memorystatsd` daemon will read its configuration from the configuration file. The daemon and its manager, `memstatsmgrd`, will be designed to:
-
-- **Read Configuration at Startup:** On startup, `memorystatsd` will read the configuration file to get the initial settings.
-- **Monitor ConfigDB for Changes:** `memstatsmgrd` will watch the `MEMORY_STATS_TABLE` in ConfigDB for any configuration changes.
-- **Update Configuration File:** When configurations are updated via CLI, `memstatsmgrd` will update the configuration file based on changes detected in ConfigDB.
-- **Restart to Apply Changes:** `memstatsmgrd` will restart the `memorystatsd` service to apply the new settings if necessary.
+1. **Read Configuration at Startup**: On startup, `memorystatsd` will read its configuration directly from the ConfigDB to initialize its settings.
+2. **Monitor ConfigDB for Changes**: `hostcfgd` will monitor the `MEMORY_STATISTICS_TABLE` in ConfigDB for any changes to the configurations.
+3. **Signal Daemon to Reload Configuration**: When configurations are updated via CLI and written to ConfigDB, hostcfgd will detect these changes and signal `memorystatsd` to reload its configuration.
+4. **Reload to Apply Changes**: `memorystatsd` will reload its configurations upon receiving the signal and apply the new settings.
**Workflow for Configuration Management**
-1. **Initial Setup:** On deployment, default settings are written to both ConfigDB and the configuration file.
-2. **Daemon Startup:** `memorystatsd` reads the configuration file to initialize its parameters.
-3. **Runtime Configuration Changes:** Administrators update settings via CLI, which writes changes to ConfigDB.
-4. **Monitor ConfigDB for Changes:** `memstatsmgrd` detects these changes in ConfigDB.
-5. **Update Configuration File:** `memstatsmgrd` updates the configuration file to reflect the new settings.
-6. **Restart Daemon:** `memstatsmgrd` restarts the `memorystatsd` service to apply the new settings.
+1. **Initial Setup**: On deployment, default settings are written to the ConfigDB.
+2. **Daemon Startup**: `memorystatsd` reads configuration from ConfigDB and initializes its parameters.
+3. **Runtime Configuration Changes**: Administrators update settings via CLI, which writes changes to ConfigDB.
+4. **Monitor ConfigDB for Changes**: `hostcfgd` detects changes in ConfigDB.
+5. **Signal Daemon to Reload Configuration**: hostcfgd signals `memorystatsd` to reload its configuration.
+6. **Reload Daemon**: `memorystatsd` reloads the configuration to apply the new settings.
## Warmboot and Fastboot Design Impact
@@ -353,17 +339,16 @@ There is no impact on warmboot/fastboot functionalities by this HLD.
| Test Case ID | Test Case Description |
|--------------|----------------------------------------------------------------------------------------------|
-| UT1 | Verify CLI to show default memory statistics for the last 15 days |
-| UT2 | Verify CLI to show detailed memory statistics with the --detail option |
-| UT3 | Verify CLI to show memory data for a custom time range using --from and --to options |
-| UT4 | Verify CLI to show selective memory metrics using the --select option |
-| UT5 | Verify CLI for error handling with incorrect syntax or invalid parameters |
-| UT6 | Verify CLI to reject future dates in --from or --to options |
-| UT7 | Verify CLI to reject cases where --from date is later than --to date |
-| UT8 | Verify CLI to configure memory data collection frequency using config memory-stats sampling-interval |
-| UT9 | Verify CLI to configure memory data retention period using config memory-stats retention-period |
-| UT10 | Verify CLI to enable memory statistics monitoring using config memory-stats enable |
-| UT11 | Verify CLI to disable memory statistics monitoring using config memory-stats disable |
+| UT1 | Verify CLI to show default memory statistics for the last 15 days |
+| UT2 | Verify CLI to show memory data for a custom time range using --from and --to options |
+| UT3 | Verify CLI to show selective memory metrics using the --select option |
+| UT4 | Verify CLI for error handling with incorrect syntax or invalid parameters |
+| UT5 | Verify CLI to reject future dates in --from or --to options |
+| UT6 | Verify CLI to reject cases where --from date is later than --to date |
+| UT7 | Verify CLI to configure memory data collection frequency using config memory-stats sampling-interval |
+| UT8 | Verify CLI to configure memory data retention period using config memory-stats retention-period |
+| UT9 | Verify CLI to enable memory statistics monitoring using config memory-stats enable |
+| UT10 | Verify CLI to disable memory statistics monitoring using config memory-stats disable |
### System Test Cases
From 83fb3bc21609caff789bd1489610cd6f2c7b98ca Mon Sep 17 00:00:00 2001
From: Arham-Nasir <100487254+Arham-Nasir@users.noreply.github.com>
Date: Mon, 19 Aug 2024 08:48:40 +0000
Subject: [PATCH 03/14] UPdated Image
---
.../images/architecture_diagram.svg | 2 +-
.../images/data_retention.svg | 4 ++--
.../images/enable_disable.svg | 4 ++--
.../images/mem_stats_configuration.svg | 2 +-
.../images/set_frequency.svg | 4 ++--
.../memory_statistics_hld.md | 21 +++++++++++--------
6 files changed, 20 insertions(+), 17 deletions(-)
diff --git a/doc/memory_statistics/images/architecture_diagram.svg b/doc/memory_statistics/images/architecture_diagram.svg
index e114c429a4..1ec21072a6 100644
--- a/doc/memory_statistics/images/architecture_diagram.svg
+++ b/doc/memory_statistics/images/architecture_diagram.svg
@@ -1,4 +1,4 @@
-
SONiC System
Memory Data
MemoryStats Daemon
(collects and logs memory data)
Data Storage
(stores in log files)Â
Unix ScoketCommunication
(handles IPC for data tranmission)
Socket Communication
Send Data Request
CLI Tools
(user interface for custom memory data display and configuration)
User
Display Results
Fetch Memory Data
Logs Memory Data
Input Commands
Config File
(Stores configuration settings that the memorystatsd daemon reads)
ConfigDB
(memory_stats_table
stores memory-stats configuration)
Reads Settings
Store Configuration
Fetch Configuration
memstatsmgrd
(Reads configuration from ConfigDB and updates them in the Config File)
Reads Configurations
Send Data Response
Updates Setttings
\ No newline at end of file
+
SONiC System
Memory Data
MemoryStats Daemon
(collects and logs memory data)
Data Storage
(stores in log files)Â
Unix SocketCommunication
(handles IPC for data transmission)
Socket Communication
Send Data Request
CLI Tools
(user interface for custom memory data display and configuration)
User
Display Results
Fetch Memory Data
Logs Memory Data
Input Commands
ConfigDB
(memory_statistics_table
stores memory-stats configuration)
Store Configuration
Fetch Configuration
HostConfigDaemon
( Listens to changes in ConfigDB, detects updates, and signals MemoryStatsDaemon )
Watches changes
Send Data Response
Send SignalÂ
in ConfigDB
\ No newline at end of file
diff --git a/doc/memory_statistics/images/data_retention.svg b/doc/memory_statistics/images/data_retention.svg
index bd09b44266..4746a15b07 100644
--- a/doc/memory_statistics/images/data_retention.svg
+++ b/doc/memory_statistics/images/data_retention.svg
@@ -1,4 +1,4 @@
-
+
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/doc/memory_statistics/images/enable_disable.svg b/doc/memory_statistics/images/enable_disable.svg
index 723c12b06a..70c1040df8 100644
--- a/doc/memory_statistics/images/enable_disable.svg
+++ b/doc/memory_statistics/images/enable_disable.svg
@@ -1,4 +1,4 @@
-
+
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/doc/memory_statistics/images/mem_stats_configuration.svg b/doc/memory_statistics/images/mem_stats_configuration.svg
index e5fd60b942..25ca673bef 100644
--- a/doc/memory_statistics/images/mem_stats_configuration.svg
+++ b/doc/memory_statistics/images/mem_stats_configuration.svg
@@ -1,4 +1,4 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/doc/memory_statistics/images/set_frequency.svg b/doc/memory_statistics/images/set_frequency.svg
index 7bb8750f7f..e236a26032 100644
--- a/doc/memory_statistics/images/set_frequency.svg
+++ b/doc/memory_statistics/images/set_frequency.svg
@@ -1,4 +1,4 @@
-
+
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/doc/memory_statistics/memory_statistics_hld.md b/doc/memory_statistics/memory_statistics_hld.md
index 2141659702..95008bdb44 100644
--- a/doc/memory_statistics/memory_statistics_hld.md
+++ b/doc/memory_statistics/memory_statistics_hld.md
@@ -116,17 +116,17 @@ The high-level feature design diagram is shown below.
- Figure 1: Feature architecture diagram showing the unix socket, daemon, ConfigDB, Config File and data file
+ Figure 1: Feature architecture diagram showing the unix socket, daemon, ConfigDB, and data file
-
+
- Figure 2: Sequence diagram for memory data show command
+ Figure 2: Sequence diagram for enabling or disabling the memory statistics monitoring feature
### Memory Collection Frequency Setting
@@ -145,20 +145,23 @@ The high-level feature design diagram is shown below.
Figure 4: Sequence diagram for setting how long the memory data should be retained