refactor: reorganize engines into dedicated directory and extract logic#145
Merged
Conversation
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.
This pull request refactors the codebase to modularize engine-related functionality, introduces new features for Docker and system monitoring, and improves SSH session management. The changes focus on code organization, reusability, and extensibility, as well as adding new capabilities for interacting with remote hosts.
Codebase modularization:
src/engines/ssh.rsandsrc/engines/sftp.rsfiles, and updated imports throughout the codebase to use the new engine modules. The main module now importsenginesinstead of individual engine files. [1] [2] [3] [4] [5]New features: Docker and system monitoring:
src/engines/docker.rswith async functions to retrieve Docker stats, list containers/images, and perform Docker actions (start, stop, remove, etc.) on remote hosts.src/engines/monitor.rswith aSystemMetricsstruct and a function to fetch comprehensive system metrics (OS, RAM, disk, CPU, etc.) from remote hosts.SSH session management improvements:
engines::ssh, reducing the overhead of establishing new sessions and improving performance. [1] [2] [3]Logging and tracing:
debug!logging calls withtracing::trace!for more granular and consistent tracing throughout SSH and engine operations. [1] [2] [3] [4] [5] [6] [7]These changes make the codebase more maintainable, extensible, and robust for future development.