Skip to content

feat: Add disk module collector and update documentation#4

Merged
dev-dami merged 2 commits intodev-dami:mainfrom
arybhatt4533:main
Dec 19, 2025
Merged

feat: Add disk module collector and update documentation#4
dev-dami merged 2 commits intodev-dami:mainfrom
arybhatt4533:main

Conversation

@arybhatt4533
Copy link

@arybhatt4533 arybhatt4533 commented Dec 15, 2025

This PR introduces the new 'disk' module collector.

What this PR adds:

  • A MetricCollector for disk space (total, used, free) using the 'sysinfo' library.
  • Integration into src/lib.rs to allow execution via gim --module disk.
  • Updates to README and documentation to reflect the new feature.

Summary by CodeRabbit

  • Documentation
    • Updated README with cleaner formatting and streamlined structure.
    • Git clone command now presented as a clickable link.
    • Default run examples expanded to demonstrate CPU, Memory, and Disk modules.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 15, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Documentation updates to README including formatting changes (bold to italic), git clone link wrapping, module reference updates, and removal of several long-form sections. Whitespace-only formatting change to src/lib.rs with no functional impact.

Changes

Cohort / File(s) Summary
Documentation Updates
README.md
Formatting: converted feature bullets from bold to italic. Content: wrapped git clone URL as clickable link, updated default run description to include CPU, Memory, and Disk modules, added disk module example. Removed sections: Current Capabilities, Planned Features, Documentation, and License.
Whitespace Formatting
src/lib.rs
End-of-file newline state adjustment; no functional changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

  • README changes are primarily cosmetic (formatting) and content restructuring with no logic impact
  • src/lib.rs change is whitespace-only with zero functional consequence

Poem

📝 A rabbit hops through docs with care,
Reformatting here and there—
Bold becomes italic, bright,
Links now clickable and right,
Cleanup done with gentle touch! 🐰

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the main changes: introducing a disk module collector and updating documentation, which align with the file modifications across README.md, src/lib.rs, src/modules/disk.rs, and src/modules/mod.rs.

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 24acf61 and d8f7aba.

📒 Files selected for processing (1)
  • src/lib.rs (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/lib.rs (1)

8-29: DiskCollector usage here assumes a collector type that doesn’t exist yet.

src/lib.rs is wired correctly in principle:

  • use crate::modules::{cpu::CpuCollector, memory::MemoryCollector, disk::DiskCollector};
  • Some("disk") => vec![Box::new(DiskCollector::new())],
  • Default collectors also include DiskCollector::new().

However, src/modules/disk.rs currently defines only DiskMetric and implements MetricCollector for it with a static collect(); there is no DiskCollector struct or new() method, and the trait impl shape doesn’t match the Box<dyn MetricCollector> usage here. As written, this will not compile.

Once you introduce a DiskCollector type and implement MetricCollector for it following the same pattern as CpuCollector/MemoryCollector (see the suggested rewrite in src/modules/disk.rs), this wiring should work as intended without further changes.

🧹 Nitpick comments (1)
README.md (1)

7-10: Consider updating the “Real-time Metrics” feature text to mention disk.

Now that a disk module exists, it may be clearer to say something like “CPU, memory, and disk usage statistics” (if that matches actual behavior), to stay consistent with the new capabilities you document below.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ffca248 and 24acf61.

📒 Files selected for processing (4)
  • README.md (2 hunks)
  • src/lib.rs (4 hunks)
  • src/modules/disk.rs (1 hunks)
  • src/modules/mod.rs (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/lib.rs (2)
src/modules/cpu.rs (1)
  • new (8-10)
src/modules/memory.rs (1)
  • new (8-10)
🔇 Additional comments (1)
src/modules/mod.rs (1)

2-3: Disk module export looks correct.

pub mod disk; cleanly exposes the new module alongside cpu and memory, matching how it’s imported in src/lib.rs.

Comment on lines +25 to 31
git clone [https://github.com/your-repo/gim.git](https://github.com/your-repo/gim.git)

# Build the project
cargo build --release

# Run with default settings
# Run with default settings (now includes CPU, Memory, and Disk)
cargo run
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix the git clone example so it’s a valid shell command.

Inside a fenced bash block, Markdown link syntax makes the command unusable when copy‑pasted. Also, you can point directly at this repo.

-# Clone the repository
-git clone [https://github.com/your-repo/gim.git](https://github.com/your-repo/gim.git)
+# Clone the repository
+git clone https://github.com/dev-dami/gim.git

This keeps the example runnable from the terminal.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
git clone [https://github.com/your-repo/gim.git](https://github.com/your-repo/gim.git)
# Build the project
cargo build --release
# Run with default settings
# Run with default settings (now includes CPU, Memory, and Disk)
cargo run
git clone https://github.com/dev-dami/gim.git
# Build the project
cargo build --release
# Run with default settings (now includes CPU, Memory, and Disk)
cargo run
🤖 Prompt for AI Agents
In README.md around lines 25–31 the git clone example uses Markdown link syntax
which breaks when copy‑pasted; replace the link-style line with a plain git
clone command that points directly at this repository using the raw HTTPS URL
(for example https://github.com/your-repo/gim.git) and render it inside a fenced
bash block so the example is runnable from the terminal.

@arybhatt4533
Copy link
Author

brother please merge it

@dev-dami dev-dami merged commit 87025d2 into dev-dami:main Dec 19, 2025
2 of 4 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