Subject: Re: bin/21078: patch to allow ifconfig clear interface stats
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: Greg A. Woods <woods@weird.com>
List: netbsd-bugs
Date: 04/09/2003 16:39:56
[ On Wednesday, April 9, 2003 at 22:28:41 (+0200), Manuel Bouyer wrote: ]
> Subject: Re: bin/21078: patch to allow ifconfig clear interface stats
>
> On Wed, Apr 09, 2003 at 08:29:15PM +0100, David Laight wrote:
> > > >Synopsis:       there is no way to clear interface stats (packet in/out) with ifconfig
> > 
> > IMHO clearing the stats shouldn't be allowed.
> > The problems arise when there are multiple bits of code that are
> > clearing the stats in order to determine the whether there have been
> > any recent errors (etc).
> > 
> > It is much better for the stats gathering code to save the old values
> > and do the subtractions - that way multple uses don't tread on each
> > other.
> 
> Sure, clearing the stats can cause such problems. But I don't see it as a
> reason to not allow doing it (if someone wants to shoot himself in the
> foot, it's his problem).

I'm not so sure about that....  I agree more with David on this one.

> I would have been happy to have this feature a number of times. Sometimes
> the only stats gathering software running is a
> netstat -i; sleep 10; netstat -i
> and in this case it's much easier to deal with small numbers.

Actually in that case you should do:

	netstat -i -w 10

Then you will get the small numbers you desire!

-- 
								Greg A. Woods

+1 416 218-0098;            <g.a.woods@ieee.org>;           <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>