Hi, On Wed, Mar 22, 2023 at 09:03:02AM -0400, Selva Nair wrote: > Can't we have a coarse timer that keeps the stats updated? It doesn't have > to be frequent as this is just for information.
I can see why you do not like the current style - but doing this with timers is something I'm not really happy with. If nobody ever presses F2 / sends SIGUSR2, we spend useless going in and out of the kernel to get statistics that nobody cares about. *If* someone wants to see what happens, and sends SIGUSR2 in short intervals ("ok, so we have 4 kbyte now, let's run $testprogram, and see what the value is afterwards"), the counters printed will be in accurate, because we've not polled the now-current numbers. (For the status file stats, the writing-of-the file is timer triggered, so then using the same event to poll the data makes sense) > > + status_printf(so, "TCP/UDP read bytes," counter_format, > > c->c2.link_read_bytes + c->c2.dco_read_bytes); > > + status_printf(so, "TCP/UDP write bytes," counter_format, > > c->c2.link_write_bytes + c->c2.dco_write_bytes); > > Same here -- have a place to read the total count from independent of dco. This is something the FreeBSD DCO counter patch introduced, and which might not have been the best idea - I think the idea was "leave the userland counters alone", but thinking about it, these should always be 0 anyway, no? So we could just overwrite them. I tend to merge this patch "as is", because it did not introduce the debatable way to do DCO counters - and come back later when we have all platforms and features working and have a better understanding of the code paths involved (like, --inactive) and then try to make it more nice. (Yes, I know, good intentions and all that) gert -- "If was one thing all people took for granted, was conviction that if you feed honest figures into a computer, honest figures come out. Never doubted it myself till I met a computer with a sense of humor." Robert A. Heinlein, The Moon is a Harsh Mistress Gert Doering - Munich, Germany g...@greenie.muc.de
signature.asc
Description: PGP signature
_______________________________________________ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel