Date: Thu, 10 Jul 2014 13:14:58 -0400 From: John Baldwin <jhb@freebsd.org> To: freebsd-net@freebsd.org Cc: Bryan Venteicher <bryanv@daemoninthecloset.org>, hiren panchasara <hiren.panchasara@gmail.com> Subject: Re: Add netbw option to systat Message-ID: <201407101314.58558.jhb@freebsd.org> In-Reply-To: <CALCpEUEj6Nc4tVWQ0G_KF4pGTUndbBsgZnMRZWybipiQPWYpUQ@mail.gmail.com> References: <CAMo0n6QD7tbObfSihfK8Sqgza-Td%2BSmfLubAcLhrBQBKfM5Fjg@mail.gmail.com> <CALCpEUEj6Nc4tVWQ0G_KF4pGTUndbBsgZnMRZWybipiQPWYpUQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday, July 02, 2014 8:54:41 pm hiren panchasara wrote: > On Wed, Jul 2, 2014 at 4:50 PM, Bryan Venteicher > <bryanv@daemoninthecloset.org> wrote: > > Awhile back, DragonlyFlyBSD added a netbw option to systat that I've ported > > to FreeBSD and found handy at various times: > > > > netbw Display aggregate and per-connection TCP receive and transmit > > rates. Only active TCP connections are shown. > > > > Leading to output such as: > > > > tcp accepts connects rcv 1.192G snd 15.77K rexmit > > > > 192.168.10.80:22 192.168.10.20:23103 rcv snd 415.7 [ NTSX ] > > 192.168.10.80:22 192.168.10.20:46560 rcv 19.80M snd 14.47K [ NTSX ] > > 192.168.10.80:22 192.168.10.20:60699 rcv snd 886.3 [ NTSX ] > > 192.168.10.81:5201 192.168.10.51:60844 rcv 293.2M snd [R TSX ] > > 192.168.10.81:5201 192.168.10.51:60845 rcv 293.5M snd [R TSX ] > > 192.168.10.81:5201 192.168.10.51:60846 rcv 293.2M snd [R TSX ] > > 192.168.10.81:5201 192.168.10.51:60847 rcv 292.9M snd [R TSX ] > > > > It uses the sequences number from the 'struct tcpcb' to derive the rates, > > which is usually good but certainly not perfect (i.e., don't set the > > interval too long). > > > > I'd like to commit this if anybody else thinks they'd find it useful. > > > > http://people.freebsd.org/~bryanv/patches/systat-netbw.patch > > I like the idea. I also like the idea. > A few things about the patch: > 1) You may want to remove the code hidden behind "#if 0" at 2 places. > 2) I am not entirely clear on why/if we need the last column with > flags but if we keep it (for compatibility of any other reason), It > would be nice to have those flags explained in the manpage: > > + mvwprintw(wnd, LINES-2, 0, > + "Rate/sec, " > + "R=rxpend T=txpend N=nodelay T=tstmp " > + "S=sack X=winscale F=fastrec"); > 3) I feel that the header line for o/p (specially 'tcp accepts and > connects' terminology) can be improved but I do not have a better > suggestion :-) 4) Should numtok() just be humanize_number? Or rather, would it simplify the code to use humanize_number? (It might not, but if it does, I think that would be preferable.) -- John Baldwin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407101314.58558.jhb>