Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bandwith unit should be optionally bps #9

Open
alfrenovsky opened this issue May 2, 2014 · 4 comments
Open

bandwith unit should be optionally bps #9

alfrenovsky opened this issue May 2, 2014 · 4 comments

Comments

@alfrenovsky
Copy link

bmon measures in Bytes per second. Wich is a useless in some scenarios.

I should be at least an option to change the units to bits per second.

@tgraf
Copy link
Owner

tgraf commented May 8, 2014

Added new -b/--use-bit option to git tree. Let me know how that works.

@tgraf tgraf closed this as completed May 8, 2014
@notgood
Copy link

notgood commented Apr 27, 2015

At the moment bmon uses all-or-nothing approach to units. Every field is either MiB, or MB, or Mbit.

But most of the times, when it comes to the network "speed", is customary to use bits. And in order to display "amount" transferred, base2 MiB or base10 MB are usually used. (religion thing, really)

It would be nice to allow to configure unit scale per field, or at least allow to customize it separately for "speed" and "amount" fields.

P.S. bmon is hands down the best console console bandwidth I've encountered so far, using it on numerous embedded openwrt routers :) Good job!

@tgraf tgraf reopened this Apr 29, 2015
@tgraf
Copy link
Owner

tgraf commented Apr 29, 2015

I agree with this and would like to accept a pull request for this feature.

dcaratti added a commit to dcaratti/bmon that referenced this issue Nov 3, 2022
when elements' lifetime reaches 0, and program is compiled with debug, bmon
gets a segmentation fault:

 Program received signal SIGSEGV, Segmentation fault.
                                                    __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:74
 Downloading 0.00 MB source file /usr/src/debug/glibc-2.34-43.fc35.x86_64/string/../sysdeps/x86_64/multiarch/strlen-avx2.S
 74              VPCMPEQ (%rdi), %ymm0, %ymm1
 (gdb) bt
 #0  __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:74
 tgraf#1  0x00007ffff7a84228 in __vfprintf_internal (s=s@entry=0x7fffffffb9f0,
     format=0x410f08 "[DBG] %20s:%-4u %s: Deleting dead element %s\n", ap=0x7fffffffdb30, mode_flags=0)
     at vfprintf-internal.c:1647
 tgraf#2  0x00007ffff7a849ef in buffered_vfprintf (s=0x7ffff7bfb6a0 <_IO_2_1_stderr_>,
     format=format@entry=0x410f08 "[DBG] %20s:%-4u %s: Deleting dead element %s\n", args=args@entry=0x7fffffffdb30,
     mode_flags=mode_flags@entry=0) at vfprintf-internal.c:2295
 tgraf#3  0x00007ffff7a839cb in __vfprintf_internal (s=<optimized out>,
     format=0x410f08 "[DBG] %20s:%-4u %s: Deleting dead element %s\n", ap=ap@entry=0x7fffffffdb30,
     mode_flags=mode_flags@entry=0) at vfprintf-internal.c:1377
 tgraf#4  0x00007ffff7a6f3ca in __fprintf (stream=<optimized out>, format=<optimized out>) at fprintf.c:32
 tgraf#5  0x0000000000406339 in __group_foreach_element (g=g@entry=0x422ae0, list=list@entry=0x4da940,
     cb=cb@entry=0x407260 <element_check_if_dead>, arg=arg@entry=0x0) at group.c:45
 tgraf#6  0x0000000000406351 in __group_foreach_element (g=g@entry=0x422ae0, list=list@entry=0x4d6d40,
     cb=cb@entry=0x407260 <element_check_if_dead>, arg=arg@entry=0x0) at group.c:48
 tgraf#7  0x0000000000406351 in __group_foreach_element (g=0x422ae0, list=0x422af0, cb=0x407260 <element_check_if_dead>,
     arg=arg@entry=0x0) at group.c:48
 tgraf#8  0x0000000000406750 in group_foreach_recursive (arg=0x0, cb=<optimized out>) at group.c:67
 tgraf#9  free_unused_elements () at group.c:192
 tgraf#10 0x00000000004041f0 in main (argc=<optimized out>, argv=0x7fffffffdfb8) at bmon.c:350
 (gdb)

this happens because 'e->e_name' is used by 'DBG()' after the call to
element_free(e); calling DBG(...) before element_free() proved to fix the
above crash.

Signed-off-by: Davide Caratti <dcaratti@redhat.com>
@ogarod
Copy link

ogarod commented May 17, 2023

Is the -b option meant to apply to output modules as well? Here's how I am using the format output module:

-o format:fmt='$(element:name)\t$(attr:rx:bytes)\t$(attr:rxrate:bytes)\t$(attr:rx:packets)\t$(attr:rxrate:packets)\n'

However it seems the units used are still bytes, even when I pass in the -b flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants