Display Statistics in "Human Readable" Format

Hi,

Kinda like the -h option in Linux (for ls), it would be nice to be able to show the items on the statistics page in human readable form.

Thanks!

What’s not human readable? Version 1.16 is plain text…

Hi,

Yes, it is! What I mean is like below (from man page on ls command),

-h, --human-readable
with -l, print sizes in human readable format (e.g., 1K 234M 2G)

Make sense?

Thanks!

It doesn’t make sense because SwOS counters are 32-bit anyway.

Huh? Sorry, perhaps missing your point. I’m not asking about the length of the counters - just making the output readable.

Thanks!

you still haven’t answered what you consider readable :slight_smile: you mean in Gigabytes?

Sorry, I thought I had - I tried with the ls comment above. But let me provide an example to try to help!

In Linux, using ls to list files … here is a listing in “non-human readable” format,
rmorris@linuxServer:/bin$ ls -alF b*
-rwxr-xr-x 1 root root 1037528 Jun 24 10:44 bash*
-rwxr-xr-x 1 root root 520992 Jan 19 17:11 btrfs*
-rwxr-xr-x 1 root root 249464 Jan 19 17:11 btrfs-calc-size*
lrwxrwxrwx 1 root root 5 Jan 19 17:11 btrfsck → btrfs*
-rwxr-xr-x 1 root root 278376 Jan 19 17:11 btrfs-convert*
-rwxr-xr-x 1 root root 249464 Jan 19 17:11 btrfs-debug-tree*
-rwxr-xr-x 1 root root 245368 Jan 19 17:11 btrfs-find-root*
-rwxr-xr-x 1 root root 270136 Jan 19 17:11 btrfs-image*
-rwxr-xr-x 1 root root 249464 Jan 19 17:11 btrfs-map-logical*
-rwxr-xr-x 1 root root 245368 Jan 19 17:11 btrfs-select-super*
-rwxr-xr-x 1 root root 253816 Jan 19 17:11 btrfs-show-super*
-rwxr-xr-x 1 root root 249464 Jan 19 17:11 btrfstune*
-rwxr-xr-x 1 root root 245368 Jan 19 17:11 btrfs-zero-log*
-rwxr-xr-x 3 root root 31288 May 20 2015 bunzip2*
-rwxr-xr-x 1 root root 1964536 Aug 19 2015 busybox*
-rwxr-xr-x 3 root root 31288 May 20 2015 bzcat*
lrwxrwxrwx 1 root root 6 May 20 2015 bzcmp → bzdiff*
-rwxr-xr-x 1 root root 2140 May 20 2015 bzdiff*
lrwxrwxrwx 1 root root 6 May 20 2015 bzegrep → bzgrep*
-rwxr-xr-x 1 root root 4877 May 20 2015 bzexe*
lrwxrwxrwx 1 root root 6 May 20 2015 bzfgrep → bzgrep*
-rwxr-xr-x 1 root root 3642 May 20 2015 bzgrep*
-rwxr-xr-x 3 root root 31288 May 20 2015 bzip2*
-rwxr-xr-x 1 root root 14616 May 20 2015 bzip2recover*
lrwxrwxrwx 1 root root 6 May 20 2015 bzless → bzmore*
-rwxr-xr-x 1 root root 1297 May 20 2015 bzmore*

And now, with the -h option, for “human readable”,
rmorris@linuxServer:/bin$ ls -alF -h b*
-rwxr-xr-x 1 root root 1014K Jun 24 10:44 bash*
-rwxr-xr-x 1 root root 509K Jan 19 17:11 btrfs*
-rwxr-xr-x 1 root root 244K Jan 19 17:11 btrfs-calc-size*
lrwxrwxrwx 1 root root 5 Jan 19 17:11 btrfsck → btrfs*
-rwxr-xr-x 1 root root 272K Jan 19 17:11 btrfs-convert*
-rwxr-xr-x 1 root root 244K Jan 19 17:11 btrfs-debug-tree*
-rwxr-xr-x 1 root root 240K Jan 19 17:11 btrfs-find-root*
-rwxr-xr-x 1 root root 264K Jan 19 17:11 btrfs-image*
-rwxr-xr-x 1 root root 244K Jan 19 17:11 btrfs-map-logical*
-rwxr-xr-x 1 root root 240K Jan 19 17:11 btrfs-select-super*
-rwxr-xr-x 1 root root 248K Jan 19 17:11 btrfs-show-super*
-rwxr-xr-x 1 root root 244K Jan 19 17:11 btrfstune*
-rwxr-xr-x 1 root root 240K Jan 19 17:11 btrfs-zero-log*
-rwxr-xr-x 3 root root 31K May 20 2015 bunzip2*
-rwxr-xr-x 1 root root 1.9M Aug 19 2015 busybox*
-rwxr-xr-x 3 root root 31K May 20 2015 bzcat*
lrwxrwxrwx 1 root root 6 May 20 2015 bzcmp → bzdiff*
-rwxr-xr-x 1 root root 2.1K May 20 2015 bzdiff*
lrwxrwxrwx 1 root root 6 May 20 2015 bzegrep → bzgrep*
-rwxr-xr-x 1 root root 4.8K May 20 2015 bzexe*
lrwxrwxrwx 1 root root 6 May 20 2015 bzfgrep → bzgrep*
-rwxr-xr-x 1 root root 3.6K May 20 2015 bzgrep*
-rwxr-xr-x 3 root root 31K May 20 2015 bzip2*
-rwxr-xr-x 1 root root 15K May 20 2015 bzip2recover*
lrwxrwxrwx 1 root root 6 May 20 2015 bzless → bzmore*
-rwxr-xr-x 1 root root 1.3K May 20 2015 bzmore*

Does this make more sense now? I have actually written code before to do such a thing - can provide a reference if that helps.

Thanks!

So basically the problem is units of measure, not formatting of output.

OK, now you lost me … :wink:

Measurement unit is fine (bytes) - but the option to display only to B, kB, MB, GB, TB … so really, don’t mess with the data, just an option to display in this format. In other words, just post-process the current data, when displaying.

Thanks!

The “-h” option might translate to “human readable” in linux, but it only changes the order of magnitude of the file sizes. It does not make the whole output of command more readable.
Now I understand that you want kilobytes and megabytes instead of bytes. You should have started with this.
I only understood that you want less data, to make it more readable.

Yes - correct! Sorry if I confused you … :frowning:

And how do you plan to reconcile your request with those that want exact outputs, not Mb and kb? Some may even parse that output for external use.
Your output format reduces the output precision and granularity. Do you think there should be 2 statistic pages? One with exact value and one “human readable”?

Hi,

Yes, don’t want to take that away! I was thinking to have a checkbox / option to show human readable form.

Thanks!

Wouldn’t a SNMP tool watching the switch do a better job - tables, graphs and stuff? E.g. the Dude? MRTG?

Hi,

Yep, I use LibreNMS for that (SNMP) - works quite well (except for a bug in SwOS, but that’s being fixed).

So when I do look at the page, looking for rough order-of-magnitude - no every last byte … :slight_smile:. But I do understand that there are others who still want that, not intending to break it!