Skip to content

hugetop: print human readable sizes by default - #688

Open
Franklin-Qi wants to merge 2 commits into
uutils:mainfrom
Franklin-Qi:fix-bug#687-print-human-readable-sizes-by-default
Open

hugetop: print human readable sizes by default#688
Franklin-Qi wants to merge 2 commits into
uutils:mainfrom
Franklin-Qi:fix-bug#687-print-human-readable-sizes-by-default

Conversation

@Franklin-Qi

Copy link
Copy Markdown
Contributor

Consistent with the hugetop command of procps-ng, change the default size to a format suitable for human reading.

Closed: #687

@codecov

codecovBot commented Apr 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 19.19%. Comparing base (ebd7d9b) to head (2754a76).
⚠️ Report is 26 commits behind head on main.

Files with missing linesPatch %Lines
src/uu/hugetop/src/hugetop.rs0.00%11 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #688 +/- ##
==========================================
- Coverage 19.19% 19.19% -0.01% 
==========================================
Files 68 68 Lines 10158 10159 +1 Branches 546 545 -1 ==========================================
Hits 1950 1950 - Misses 8208 8209 +1 
FlagCoverage Δ
macos_latest6.74% <0.00%> (-0.01%)⬇️
ubuntu_latest19.55% <0.00%> (-0.01%)⬇️
windows_latest0.02% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sylvestre

Copy link
Copy Markdown
Contributor

some jobs are failing

@Franklin-Qi
Franklin-Qiforce-pushed the fix-bug#687-print-human-readable-sizes-by-default branch from 68c6013 to 0acb632CompareJune 4, 2026 12:58
@sylvestre

Copy link
Copy Markdown
Contributor

clippy is sad :)

@Franklin-Qi
Franklin-Qiforce-pushed the fix-bug#687-print-human-readable-sizes-by-default branch from 0acb632 to 76c7cf9CompareJune 4, 2026 13:06
@Franklin-Qi

Copy link
Copy Markdown
ContributorAuthor

clippy is sad :)

Thank you for your review, I am revising it.

@Franklin-Qi
Franklin-Qiforce-pushed the fix-bug#687-print-human-readable-sizes-by-default branch 6 times, most recently from 78070fa to bd20d1fCompareJune 5, 2026 09:09
@Krysztal112233

Krysztal112233 commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

I noticed that procps-ng has -H--human flag

procps/src on  master via C v15.2.0-gcc ❯ ./hugetop -h
Usage:
hugetop [options]
Options:
-d, --delay <secs> delay updates
-n, --numa display per NUMA nodes Huge pages information
-o, --once only display once, then exit
-H, --human display human-readable output
-h, --help display this help and exit
-V, --version output version information and exit

And in procps-ng, this parameter affects how the entries are output:

procps/src on  master [?] via C v15.2.0-gcc ❯ sudo ./hugetop -H --o hugetop - Fri Jun 5 17:34:20 2026
node(s): 2.0Mi - 5/8, 1.0Gi - 0/0
PID SHARED PRIVATE COMMAND 44101 0B 6.0Mi hugetlb_test
-------
NOTICE HERE
procps/src on  master [?] via C v15.2.0-gcc ❯ sudo ./hugetop --o hugetop - Fri Jun 5 17:34:24 2026
node(s): 2.0Mi - 5/8, 1.0Gi - 0/0
PID SHARED PRIVATE COMMAND 44101 0 6144 hugetlb_test
-------
NOTICE HERE

But in this pr

procps on  fix-bug#687-print-human-readable-sizes-by-default [$] is 📦 v0.0.1 via 🦀 v1.96.0 took 6s ❯ cargo run -q hugetop -o -H
hugetop - Fri Jun 5 17:35:44 2026
node(s): 2.0Mi - 5/8, 1.0Gi - 0/0
PID SHARED PRIVATE COMMAND
44101 0B 6.0Mi hugetlb_test
-------
NOTICE HERE
procps on  fix-bug#687-print-human-readable-sizes-by-default [$] is 📦 v0.0.1 via 🦀 v1.96.0 took 3s ❯ cargo run -q hugetop -o hugetop - Fri Jun 5 17:35:49 2026
node(s): 2.0Mi - 5/8, 1.0Gi - 0/0
PID SHARED PRIVATE COMMAND
44101 0B 6.0Mi hugetlb_test
-------
NOTICE HERE

So please fixed this mistake :)

@Franklin-Qi

Franklin-Qi commented Jun 5, 2026

Copy link
Copy Markdown
ContributorAuthor

Okay, @Krysztal112233 thank you for the suggestion; I will handle this situation.

@Franklin-Qi
Franklin-Qiforce-pushed the fix-bug#687-print-human-readable-sizes-by-default branch from a22929d to 3a26c36CompareJune 16, 2026 03:19
Consistent with the hugetop command of `procps-ng`, change the default size to a format suitable for human reading.
1. Node summary always human-readable;
2. Process columns respect -H flag
Closes: uutils#687
@Franklin-Qi
Franklin-Qiforce-pushed the fix-bug#687-print-human-readable-sizes-by-default branch from 3a26c36 to 66b4450CompareJune 16, 2026 03:24
@Franklin-Qi

Franklin-Qi commented Jun 16, 2026

Copy link
Copy Markdown
ContributorAuthor

The error message from Basic CI / cargo test (ubuntu-latest) is a legacy issue from w and a pull request has been submitted: #718

Sign up for freeto 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.

hugetop: print human readable sizes by default

3 participants

@Franklin-Qi@sylvestre@Krysztal112233