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

Implemented GetDiskUsage() function #11

Merged
merged 1 commit into from
Oct 1, 2020

Conversation

S-Maciejewski
Copy link
Contributor

This pull request relates to the issue #1

The GetDiskUsage() method in memory.go was implemented using gopsutil library's disk.Usage function. The result is displayed by ResultPrinter function as a percentage of disk usage as well as the disk space available, consistent with GetRamUsage().

memory.go Outdated
Comment on lines 29 to 31
usedPercent := fmt.Sprintf("%f", diskUsage.UsedPercent)
ResultPrinter("Disk Usage: ", usedPercent+"%")
ResultPrinter("Disk Space Available: ", diskUsage.Free)
Copy link
Member

Choose a reason for hiding this comment

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

try formatting the disk usage percentage to two decimal places

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Member

@DarthBenro008 DarthBenro008 left a comment

Choose a reason for hiding this comment

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

Please format it to two decimal places, same will be updated with RAM usage too.

Disk Usage output formatted to two decimal places
Copy link
Member

@DarthBenro008 DarthBenro008 left a comment

Choose a reason for hiding this comment

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

LGTM

@DarthBenro008 DarthBenro008 merged commit b9d63ac into IEEE-VIT:master Oct 1, 2020
@DarthBenro008 DarthBenro008 linked an issue Oct 1, 2020 that may be closed by this pull request
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.

[Feature] Disk Usage Stats
2 participants