htop-dev / htop

htop - an interactive process viewer
https://htop.dev/
GNU General Public License v2.0
6.53k stars 440 forks source link

`DISK READ`/`DISK WRITE` column changes #991

Open BenBE opened 2 years ago

BenBE commented 2 years ago

The columns DISK READ and DISK WRITE currently show as %5.2f %sB/s like e.g. 0.00 B/s. This makes those columns quite long compared to other columns. Also showing whole bytes with two significant digits is somewhat unnecessary precision.

What about shortening the column labels to RDISK/WDISK and the display of the actual column value as follows:

  1. Values below 1KiB/s are shaded
  2. Values below 1KiB/s displayed in bytes
  3. Starting with 1KiB/s values receive 3-4 significant digits and the usual unit suffices.
  4. Shading of MiB/s, GiB/s and TiB/s done similar to normal byte counts.

Currently each of the two column takes up 10 characters, when similar columns like RCHAR/WCHAR (Number of bytes read/written) use 5 chars.

NikhilReddy-2 commented 2 years ago

Hey, would love to take this up if there hasn't been any work done on it yet as this looks like a good starting point to get into this repo.

Has there been any further discussion on this on any other PRs?

BenBE commented 2 years ago

There has not been any further discussion I'm aware of. Usually issues are heavily cross-referenced, thus if nothing shows here, it's unlikely there was essential discussion.

Thus feel free to take this one up. There's some documentation on the code style available in the docs folder. Also don't hesitate to ask if you've got any questions.

marcluque commented 2 years ago

Do you still want to work on this @NikhilReddy-2? If not I would gladly give it a try. From what I saw on the main branch, the proposed changes weren't done yet.

AryanGitHub commented 1 month ago

Can we also reduce the column size of DISK R/W (Total I/O rate in bytes per second)? Its column title size is also 12 characters (" DISK R/W ") along with DISK READ/DISK WRITE. All three of these process fields are using "Row_printRate" in Rox.c.

If we consider fixing all three issues, we can directly change the function "Row_printRate" in Rox.c to address this.

I also wanted to know if, while changing the total width of "Row_printRate," we need to modify this line in ./pcp/PCPDynamicColumn.c: column->super.width = 11; // Row_printRate here.