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

Fix memory and swap values reported by 'iotedge check' and edge agent #6943

Merged
merged 5 commits into from
Mar 10, 2023

Conversation

nlcamp
Copy link
Contributor

@nlcamp nlcamp commented Mar 6, 2023

Fixes several bugs related to reported system RAM and swap values:

  1. Units conversion bug introduced by a recent upgrade from sysinfo v0.25 to v0.27, resulting in edgeAgent_total_memory_bytes and edgeAgent_used_memory_bytes for "module_name=host" being 1024 times higher than the value previously reported in iotedge v1.4.3.
  2. Long-standing bug in edgeAgent_total_memory_bytes and edgeAgent_used_memory_bytes for "module_name=host", where the reported values were 1.024 times higher than the actual values. This was caused by incorrectly treating the values returned by sysinfo v0.25 as KiB instead of KB.
  3. Long-standing bug in system info reported by 'iotedge check', where the total_ram, total_swap, used_ram, and used_swap values were 1.024 times higher than the actual values. This was also caused by incorrectly treating the value returned by sysinfo v0.25 as KiB instead of KB.

The changes in this PR have been tested by building an aziot-edge package using the CI pipeline and installing it on a VM device. The 'iotedge check' and edgeAgent metrics were then checked to confirm that the values are now correct.

Azure IoT Edge PR checklist:

This checklist is used to make sure that common guidelines for a pull request are followed.

General Guidelines and Best Practices

  • I have read the contribution guidelines.
  • Title of the pull request is clear and informative.
  • Description of the pull request includes a concise summary of the enhancement or bug fix.

Testing Guidelines

  • Pull request includes test coverage for the included changes.
  • Description of the pull request includes
    • concise summary of tests added/modified
    • local testing done.

Draft PRs

  • Open the PR in Draft mode if it is:
    • Work in progress or not intended to be merged.
    • Encountering multiple pipeline failures and working on fixes.

Note: We use the kodiakhq bot to merge PRs once the necessary checks and approvals are in place. When it merges a PR, kodiakhq converts the PR title to the commit title, PR description to the commit description, and squashes all the commits in the PR to a single commit. The net effect is that entire PR becomes a single commit. Please follow the best practices mentioned here for the PR title and description

@nlcamp nlcamp marked this pull request as ready for review March 6, 2023 23:34
@nlcamp nlcamp requested a review from damonbarry March 6, 2023 23:35
damonbarry
damonbarry previously approved these changes Mar 9, 2023
@nlcamp nlcamp changed the title Fix System Resources units conversion bug Fix memory and swap values reported by 'iotedge check' and edge agent Mar 10, 2023
@nlcamp nlcamp requested a review from damonbarry March 10, 2023 03:36
@kodiakhq kodiakhq bot merged commit b29d736 into Azure:release/1.4 Mar 10, 2023
nlcamp added a commit to nlcamp/iotedge that referenced this pull request Mar 10, 2023
…Azure#6943)

Fixes several bugs related to reported system RAM and swap values:
1. Units conversion bug introduced by a recent upgrade from sysinfo v0.25 to v0.27, resulting in edgeAgent_total_memory_bytes and edgeAgent_used_memory_bytes for "module_name=host" being 1024 times higher than the value previously reported in iotedge v1.4.3.
2. Long-standing bug in edgeAgent_total_memory_bytes and edgeAgent_used_memory_bytes for "module_name=host", where the reported values were 1.024 times higher than the actual values. This was caused by incorrectly treating the values returned by sysinfo v0.25 as KiB instead of KB.
3. Long-standing bug in system info reported by 'iotedge check', where the total_ram, total_swap, used_ram, and used_swap values were 1.024 times higher than the actual values. This was also caused by incorrectly treating the value returned by sysinfo v0.25 as KiB instead of KB.

The changes in this PR have been tested by building an aziot-edge package using the CI pipeline and installing it on a VM device. The 'iotedge check' and edgeAgent metrics were then checked to confirm that the values are now correct.

## Azure IoT Edge PR checklist:
kodiakhq bot pushed a commit that referenced this pull request Mar 11, 2023
…#6953)

Cherry-pick from (#6943)

Fixes several bugs related to reported system RAM and swap values:
1. Units conversion bug introduced by a recent upgrade from sysinfo v0.25 to v0.27, resulting in edgeAgent_total_memory_bytes and edgeAgent_used_memory_bytes for "module_name=host" being 1024 times higher than the value previously reported in iotedge v1.4.3.
2. Long-standing bug in edgeAgent_total_memory_bytes and edgeAgent_used_memory_bytes for "module_name=host", where the reported values were 1.024 times higher than the actual values. This was caused by incorrectly treating the values returned by sysinfo v0.25 as KiB instead of KB.
3. Long-standing bug in system info reported by 'iotedge check', where the total_ram, total_swap, used_ram, and used_swap values were 1.024 times higher than the actual values. This was also caused by incorrectly treating the value returned by sysinfo v0.25 as KiB instead of KB.

The changes in this PR have been tested by building an aziot-edge package using the CI pipeline and installing it on a VM device. The 'iotedge check' and edgeAgent metrics were then checked to confirm that the values are now correct.

## Azure IoT Edge PR checklist:
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