Skip to content

Refactor of the dimm collector - #288

Merged
alexandraBara merged 10 commits into
developmentfrom
refactor/dimm_collector
Sep 30, 2026
Merged

alexandraBara merged 10 commits into
developmentfrom
refactor/dimm_collector

Conversation

@graepaul

@graepaul graepaul commented Sep 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Improve full memory dmidecode for linux.
  • Adding a full decode of wmic for windows.
  • Improved unit-tests

Here is what a dimm looks like

{
  "dimms": [
    {
      "size_bytes": 103079215104,
      "locator": "CPU0_A",
      "bank_locator": "_Node0_Channel0_Dimm0",
      "manufacturer": "Samsung",
      "part_number": "M321RYGA0PB0-CWMXJ",
      "serial_number": "1234-567889AB",
      "memory_type": "DDR5",
      "form_factor": "DIMM",
      "speed_mts": 5600,
      "configured_speed_mts": 5600,
      "rank": 2,
      "data_width_bits": 64,
      "total_width_bits": 80,
      "size": "96GB"
    },
...

Test plan

  • pytest test/unit - Improved unit-tests which now runs against a large fixtures file validating functionality.
  • pytest test/functional (if applicable) - N/A
  • pre-commit run --all-files

Checklist

  • Added/updated tests (or explained why not)
  • Updated docs/README if behavior changed
  • No secrets or credentials committed

@graepaul graepaul changed the title Fix some typing warnings Refactor of the dimm collector Sep 17, 2026
Comment thread nodescraper/plugins/inband/dimm/dimmdata.py Outdated

@amd-ansonyim amd-ansonyim left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, just one thing


return self._parse_wmic_csv(res.stdout)

def _log_cmd_error(self, res: CommandArtifact) -> None:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

res is called but not used. Do we need to add that to the log_event? Right now I think end user will just see "Error checking dimms" with no further context

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it uses it see code snippet:

    def _log_cmd_error(self, res: CommandArtifact) -> None:
        """Log a failed memory query without aborting the rest of the collection.

        Args:
            res (CommandArtifact): result of the failed command.
        """
        self._log_event(
            category=EventCategory.OS,
            description="Error checking dimms",
            priority=EventPriority.ERROR,
            data=res.model_dump(include={"command", "stderr", "exit_code"}),
            console_log=True,
        )

Comment thread nodescraper/plugins/inband/dimm/dimm_collector.py

@alexandraBara alexandraBara left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@graepaul updates look good, but utest needs to be updated

@graepaul

Copy link
Copy Markdown
Collaborator Author

I renamed the fixture name in the unit test and it passes now.

@alexandraBara
alexandraBara merged commit ccb0e37 into development Sep 30, 2026
7 checks passed
@alexandraBara
alexandraBara deleted the refactor/dimm_collector branch September 30, 2026 22:10
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.

3 participants