Additional library support and auto installation of dependencies. #13
Merged
kennethdsheridan merged 5 commits intomainfrom May 25, 2025
Merged
Additional library support and auto installation of dependencies. #13kennethdsheridan merged 5 commits intomainfrom
kennethdsheridan merged 5 commits intomainfrom
Conversation
- Add comprehensive library usage documentation to README - Create examples directory with two example programs: - basic_usage.rs: Shows basic library usage and serialization - custom_analysis.rs: Demonstrates advanced analysis capabilities - Document Library API with examples for NUMA filtering and custom serialization - Project already had proper lib/bin separation, no refactoring needed This allows the hardware_report crate to be used as a dependency in other Rust projects. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Replace automatic package installation with informative warnings - Show missing utilities and their purposes - Provide manual installation instructions for Ubuntu/Debian and RHEL/Fedora - Make utility checks graceful - continue with limited functionality if utilities are missing - Update NUMA, network, PCI, and memory collection to handle missing utilities This prevents the binary from attempting to install system packages automatically, which was causing issues in production environments. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Automatically detect and install numactl if not present - Support for multiple package managers (apt, dnf, yum, zypper) - Check for sudo/root privileges before installation - Verify successful installation after completion 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Changed Files
|
- Format code according to rustfmt standards - Fix formatting in lib.rs and example files - Ensure consistent code style throughout project 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Replace vec\! with array slices for core_utils and specialized_tools - Fix clippy::useless_vec warnings 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR adds library support to hardware_report and implements automatic installation of the
numactldependency when it's not present on the system.What's Changed
New Features
Library Support
ServerInfo::collect()methodserdefor all data structuresAutomatic numactl Installation
numactlis missing on system startupUsage Examples
examples/basic_usage.rs- demonstrates basic library usageexamples/custom_analysis.rs- shows advanced filtering and analysisDocumentation
Breaking Changes
None - all existing CLI functionality remains unchanged.
Testing
Example Usage