[PATCH] new applet: nmeter

Rich Felker dalias at aerifal.cx
Wed Jul 5 19:43:49 UTC 2006


On Wed, Jul 05, 2006 at 06:31:56PM +0200, Denis Vlasenko wrote:
> Hi,
> 
> The patch adds the following applet:
> 
> # ./busybox nmeter 
> BusyBox v1.2.0 (2006.07.04-21:29+0000) multi-call binary 
>  
> Usage: nmeter format_string 
>  
> Nmeter monitors your system in real time. 
>  
> Format specifiers: 
> %Nc or %[cN]    monitor CPU. N - bar size, default 10 
>                 (displays: S:system U:user N:niced D:iowait I:irq i:softirq) 
> %[niface]       monitor network interface 'iface' 
> %m              monitor allocated memory 
> %[mf]           monitor free memory 
> %[mt]           monitor total memory 
> %s              monitor allocated swap 
> %f              monitor number of used file descriptors 
> %Ni             monitor total/specific IRQ rate 
> %x              monitor context switch rate 
> %p              monitor forks 
> %[pn]           monitor # of processes 
> %b              monitor block io 
> %Nt             show time (with N decimal points) 
> %Nd             milliseconds between updates (default=1000) 
> %r              print <cr> instead of <lf> at EOL 
> 
> Size of the applet (make objsizes):
> 
> text+data text+rodata    rwdata       bss filename 
>      5090        4954       136      4104 miscutils/nmeter.o 
> 
> Run tested.

looks rather large relative to what it does. what about removing some
of the cruft from the source at least, like the non-USE_LOCALTIME
cases? also imo the code would be smaller using strftime for printing
times instead of inlining the hh:mm:ss string generation, etc. since
strftime is already used in bb anyway.

just some ideas, dunno if the maintainers will agree or not.

rich




More information about the busybox mailing list