raboof / nethogs

Linux 'net top' tool
GNU General Public License v2.0
3.14k stars 286 forks source link

unintelligible units #261

Closed hramrach closed 1 year ago

hramrach commented 1 year ago

What I see in the output is

31837 hramra.. ssh tun0 0.355 7.717 KB/s

what does that mean?

There is no unit prefix known to me corresponding to the symbol K.

In networking and storage B is interchangeably used for bits and bytes giving interpretations that differ in order of magnitude.

The documentation says on this: -v view mode (0 = KB/s, 1 = total KB, 2 = total B, 3 = total MB, 4 = MB/s, 5 = GB/s). default is 0.

Nothing new to be learned there.

raboof commented 1 year ago

I'm pretty sure uppercase 'B' always means 'byte', can you reference any widely accepted convention where this is not the case?

Of course this still leaves the 1024 vs 1000 confusion. https://github.com/raboof/nethogs/blob/main/src/process.cpp#L73-L82 shows in our case it's multiples of 1024. I agree it would be nice to make this less ambiguous. Whoever contributes that improvement gets to choose the way they'd like to approach that.

hramrach commented 1 year ago

Where is that specified?

As far as I can tell b and B are used interchangeably, there is no convention to speak of in this area.

raboof commented 1 year ago

I searched around a bit but I only see uppercase-B used to mean 'bytes'. Can you even find one credible source using uppercase B to mean 'bits'?

hramrach commented 1 year ago

Credible is not relevant. The fact that people use it that way remains. I do not trust any random tool author to get this right. Consequently, output that relies on B capitalization for interpreting the result is unintelligible.

raboof commented 1 year ago

Can you even find one source using uppercase B to mean 'bits'?

hramrach commented 1 year ago

https://www.reddit.com/r/networking/comments/3c8kdl/10mb_vs_100mb_cabling_question/

10MB vs 100MB cabling question.

raboof commented 1 year ago

Damn, you got me there!

Anyway, let's keep it friendly - I admit I got a bit frustrated as your "unintelligible", "Nothing new to be learned there.", "Where is that specified?" and "any random tool author" seemed a bit harsh.

You're very welcome to propose any clarification!