Skip to content

Added Disk Usage Statistics#49

Merged
ada4a merged 1 commit into
cosmic-utils:mainfrom
ErenYeager1709:main
Jul 3, 2026
Merged

Added Disk Usage Statistics#49
ada4a merged 1 commit into
cosmic-utils:mainfrom
ErenYeager1709:main

Conversation

@ErenYeager1709

Copy link
Copy Markdown
Contributor

Hello! I wanted to add support for displaying disk read and write values.

The read/write values of all disks (or more precisely, all mount points) are summed up and displayed as a single value.

I used a HashSet to filter out duplicate devices because disks.list() returns a list of mount points and not a list of drives or partitions. In my case, both "/" and "/home" are mounted from the same partition. Since the read/write statistics are tied to the partitions rather than the mount points, iterating over all mount points caused my partition to be counted twice.
By keeping track of the partition names in a HashSet, each partition is only counted once, preventing duplicated read/write values.

Comment thread src/data/mod.rs Outdated
@rwxroot
rwxroot requested a review from ada4a July 2, 2026 12:34
Comment thread Cargo.toml Outdated
Comment thread src/data/mod.rs Outdated
Comment thread src/template/parse.rs

@ada4a ada4a 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, thank you:)

Could you please squash down the commits?

Both values can be showcased via "{disk_read}" and "{disk_write}" in
MB/s
@ErenYeager1709

Copy link
Copy Markdown
Contributor Author

Should be done. Thanks for the quick response.

@ada4a
ada4a merged commit 73534ea into cosmic-utils:main Jul 3, 2026
1 check passed
@rwxroot

rwxroot commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

@ErenYeager1709 @ada4a Thank you for the great work.

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.

3 participants