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

Cleanup stats pkg globals #1702

Merged

Conversation

maryamtahhan
Copy link
Collaborator

  • Extract the functions to identify node information from the stats package and into a new node package + wrap it in a simple interface that can be used wherever needed.

  • Clean up globals in pkg/collector/stats

Copy link
Contributor

github-actions bot commented Aug 19, 2024

🤖 SeineSailor

Here is a concise summary of the pull request changes:

Summary: The pull request refactors the stats package, extracting node-related functions into a new node package, introducing a MetricSets data structure, and simplifying interfaces for better modularity and reusability.

Key Modifications:

  1. Node globals cleanup: Removed global variables, introducing a more structured approach with the MetricSets data structure.
  2. Node package creation: Extracted functions related to node information from the stats package into a new node package, wrapped in a simple interface.
  3. Simplified interfaces: Refactored functions like NewNodeInfo(), Name(), CPUArchitecture(), MetadataFeatureNames(), and MetadataFeatureValues() for easier reuse.

Impact on Codebase:

  • Improved modularity and reusability of code
  • Simplified interfaces for better maintainability
  • Reduced global variables, making the code more structured and easier to understand

Observations/Suggestions:

  • The changes seem to be well-structured and follow a clear refactoring strategy.
  • It would be beneficial to include additional tests to ensure the new node package and MetricSets data structure are functioning as expected.
  • Consider adding documentation or comments to explain the reasoning behind the changes and the benefits of the new node package and MetricSets data structure.

@maryamtahhan maryamtahhan changed the title Cleanup node globals Cleanup stats pkg globals Aug 19, 2024
@maryamtahhan maryamtahhan force-pushed the cleanup-node-globals branch 2 times, most recently from 81dcf9c to 86456ec Compare September 9, 2024 09:57
@maryamtahhan maryamtahhan force-pushed the cleanup-node-globals branch 2 times, most recently from 1f3bc1c to 349f00c Compare September 9, 2024 13:02
@maryamtahhan maryamtahhan merged commit 49f1f6f into sustainable-computing-io:main Sep 10, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants