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
Copy link
Copy Markdown

codecov Bot commented Apr 30, 2026

Codecov Report

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

Files with missing lines Patch % Lines
src/uu/hugetop/src/hugetop.rs 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #688      +/-   ##
==========================================
- Coverage   19.19%   19.19%   -0.01%     
==========================================
  Files          68       68              
  Lines       10158    10161       +3     
  Branches      546      546              
==========================================
  Hits         1950     1950              
- Misses       8208     8211       +3     
Flag Coverage Δ
macos_latest 6.74% <0.00%> (-0.01%) ⬇️
ubuntu_latest 19.54% <0.00%> (-0.01%) ⬇️
windows_latest 0.02% <0.00%> (-0.01%) ⬇️

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-Qi force-pushed the fix-bug#687-print-human-readable-sizes-by-default branch from 68c6013 to 0acb632 Compare June 4, 2026 12:58
@sylvestre
Copy link
Copy Markdown
Contributor

clippy is sad :)

@Franklin-Qi Franklin-Qi force-pushed the fix-bug#687-print-human-readable-sizes-by-default branch from 0acb632 to 76c7cf9 Compare June 4, 2026 13:06
@Franklin-Qi
Copy link
Copy Markdown
Contributor Author

clippy is sad :)

Thank you for your review, I am revising it.

@Franklin-Qi Franklin-Qi force-pushed the fix-bug#687-print-human-readable-sizes-by-default branch 5 times, most recently from ef15af9 to 78070fa Compare June 4, 2026 13:56
Consistent with the hugetop command of `procps-ng`, change the default size to a format suitable for human reading

Closes: uutils#687
@Franklin-Qi Franklin-Qi force-pushed the fix-bug#687-print-human-readable-sizes-by-default branch from 78070fa to bd20d1f Compare June 5, 2026 09:09
@Krysztal112233
Copy link
Copy Markdown
Collaborator

Krysztal112233 commented Jun 5, 2026

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
Copy link
Copy Markdown
Contributor Author

Franklin-Qi commented Jun 5, 2026

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

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.

hugetop: print human readable sizes by default

3 participants