Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jul 2014 00:29:38 -0500
From:      Bryan Venteicher <bryanv@daemoninthecloset.org>
To:        hiren panchasara <hiren.panchasara@gmail.com>
Cc:        "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Subject:   Re: Add netbw option to systat
Message-ID:  <CAMo0n6TFe4B0V7gyLx35ysrCTC=gtQuMpY=dPtfEUTdwcfKX8g@mail.gmail.com>
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 Wed, Jul 2, 2014 at 7:54 PM, hiren panchasara <hiren.panchasara@gmail.co=
m
> 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 rexmi=
t
> >
> >   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 rate=
s,
> > 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.
>
> A few things about the patch:
> 1) You may want to remove the code hidden behind "#if 0" at 2 places.
>


=E2=80=8BThat's inherited as is from the =E2=80=8BDragonflyBSD code, and I =
was trying to
keep the diff relativity small with upstream. I'll remove it the hidden
code.



> 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=3Drxpend T=3Dtxpend N=3Dnodelay T=3Dtstmp "
> +  "S=3Dsack X=3Dwinscale F=3Dfastrec");
>

=E2=80=8BYes, I'll document them.=E2=80=8B


> 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 :-)
>
> It looks okay me otherwise and thanks for your work.
>
> cheers,
> Hiren
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAMo0n6TFe4B0V7gyLx35ysrCTC=gtQuMpY=dPtfEUTdwcfKX8g>