scottchiefbaker / dool

Python3 compatible fork of dstat
GNU General Public License v3.0
332 stars 64 forks source link

Revert commit b19d276 but keep the last 'K' for kibibyte uppercased #34

Closed Low-power closed 1 year ago

Low-power commented 1 year ago
ISSUE TYPE
DSTAT VERSION

Commit b19d276

SUMMARY

From message of last commit:

Not sure why "k" and "b" were lowercase while ALL of the others
were uppercase

The first and second k indicates 'kilo-' from SI, means *1000; it have to be lowercased according to it.

The first b is unit 'bit'; we usually writing it in lowercase, to distinguish it from unit 'byte', which is usually writing as B.

The third k -> K indicates 'kibi-', means *1024; and in this context, the complete unit is kibibyte (KiB), so the uppercase K is simply a compact abbreviation to KiB.

Of course those compact formats will never be fully complying with SI, due to screen space restriction; but it should be at least be close to it, as well as be consistent with other command line tools.

scottchiefbaker commented 1 year ago

Apologies... Github was not sending me alerts for issues and pull requests on this repo. I did not see this until just now.

Is this still relevant? I'm working through some backlog.

scottchiefbaker commented 1 year ago

@Low-power I'm curious if we should have the b / B options for the second two options. For consistency with the first section of that if the first unit is a space (not a b).

In other words should we report 12 bytes as "12" or "12B"

Low-power commented 1 year ago

In other words should we report 12 bytes as "12" or "12B"

Yep, I see your point. I sometimes considers this single B letter appended to the value a bit weird, since most other tools (such as ls(1)) didn't use any unit/suffix for unscaled byte values.