Community discussions

MikroTik App
 
arrmo
just joined
Topic Author
Posts: 15
Joined: Sun May 29, 2016 10:25 pm

Display Statistics in "Human Readable" Format

Sun May 29, 2016 10:35 pm

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!
 
User avatar
k6ccc
Forum Guru
Forum Guru
Posts: 1497
Joined: Fri May 13, 2016 12:01 am
Location: Glendora, CA, USA (near Los Angeles)
Contact:

Re: Display Statistics in "Human Readable" Format

Mon Jun 06, 2016 6:21 am

What's not human readable? Version 1.16 is plain text...
 
arrmo
just joined
Topic Author
Posts: 15
Joined: Sun May 29, 2016 10:25 pm

Re: Display Statistics in "Human Readable" Format

Mon Jun 06, 2016 3:35 pm

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!
 
laurinkus
Member Candidate
Member Candidate
Posts: 114
Joined: Thu Aug 31, 2006 5:05 pm
Location: Europe

Re: Display Statistics in "Human Readable" Format

Thu Jul 14, 2016 11:33 pm

It doesn't make sense because SwOS counters are 32-bit anyway.
 
arrmo
just joined
Topic Author
Posts: 15
Joined: Sun May 29, 2016 10:25 pm

Re: Display Statistics in "Human Readable" Format

Fri Jul 15, 2016 7:32 am

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

Thanks!
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26385
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: Display Statistics in "Human Readable" Format

Fri Jul 15, 2016 10:22 am

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 :) you mean in Gigabytes?
 
arrmo
just joined
Topic Author
Posts: 15
Joined: Sun May 29, 2016 10:25 pm

Re: Display Statistics in "Human Readable" Format

Fri Jul 15, 2016 12:20 pm

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!
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26385
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: Display Statistics in "Human Readable" Format

Fri Jul 15, 2016 12:25 pm

So basically the problem is units of measure, not formatting of output. 
 
arrmo
just joined
Topic Author
Posts: 15
Joined: Sun May 29, 2016 10:25 pm

Re: Display Statistics in "Human Readable" Format

Fri Jul 15, 2016 12:30 pm

OK, now you lost me ... ;)

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!
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 26385
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia

Re: Display Statistics in "Human Readable" Format

Fri Jul 15, 2016 12:50 pm

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. 
 
arrmo
just joined
Topic Author
Posts: 15
Joined: Sun May 29, 2016 10:25 pm

Re: Display Statistics in "Human Readable" Format

Fri Jul 15, 2016 2:11 pm

Yes - correct! Sorry if I confused you ... :(
 
User avatar
docmarius
Forum Guru
Forum Guru
Posts: 1222
Joined: Sat Nov 06, 2010 12:04 pm
Location: Timisoara, Romania
Contact:

Re: Display Statistics in "Human Readable" Format

Fri Jul 15, 2016 2:23 pm

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"?
Last edited by docmarius on Fri Jul 15, 2016 2:29 pm, edited 2 times in total.
 
arrmo
just joined
Topic Author
Posts: 15
Joined: Sun May 29, 2016 10:25 pm

Re: Display Statistics in "Human Readable" Format

Fri Jul 15, 2016 2:28 pm

Hi,

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

Thanks!
 
User avatar
docmarius
Forum Guru
Forum Guru
Posts: 1222
Joined: Sat Nov 06, 2010 12:04 pm
Location: Timisoara, Romania
Contact:

Re: Display Statistics in "Human Readable" Format

Fri Jul 15, 2016 2:30 pm

Wouldn't a SNMP tool watching the switch do a better job - tables, graphs and stuff? E.g. the Dude? MRTG?
 
arrmo
just joined
Topic Author
Posts: 15
Joined: Sun May 29, 2016 10:25 pm

Re: Display Statistics in "Human Readable" Format

Fri Jul 15, 2016 2:34 pm

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 ... :). But I do understand that there are others who still want that, not intending to break it!

Who is online

Users browsing this forum: No registered users and 51 guests