Change in libosmocore[master]: select: gather statistics for TCP connections

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Thu Dec 16 11:29:43 UTC 2021


pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/26454 )

Change subject: select: gather statistics for TCP connections
......................................................................


Patch Set 9: Code-Review-1

(3 comments)

Maybe the thing here is that I don't really see the point in having that done for all TCP sockets. Specially not by default. IMHO the app should specifically allocate and register specific sats_tcp-entry to the API and then they would become available. If then you still want to have somehow a possibility to get all the sockets registered automatically (which I don't see the point), then one may register those as done here but have it disabled by default. But in this case there's going to be no hood "name" or "description" to show for those, well maybe yes, by printing rem_addr:rem_port<->local_addr:local_port or alike on its stats name.

Those are my ideas. If you still find the current solution acceptable then feel free to merge it.

https://gerrit.osmocom.org/c/libosmocore/+/26454/9/src/select.c 
File src/select.c:

https://gerrit.osmocom.org/c/libosmocore/+/26454/9/src/select.c@188 
PS9, Line 188: 	osmo_stats_tcp_osmo_fd_unregister(fd);
so we are now converting a O(k) operation into an O(n) one.
Also if user is responsible of registering it, I'd argue it should also be responsible from unregistering it here.


https://gerrit.osmocom.org/c/libosmocore/+/26454/9/src/stats_tcp.c 
File src/stats_tcp.c:

https://gerrit.osmocom.org/c/libosmocore/+/26454/9/src/stats_tcp.c@194 
PS9, Line 194: 		return;
return error?


https://gerrit.osmocom.org/c/libosmocore/+/26454/9/src/stats_tcp.c@210 
PS9, Line 210: void osmo_stats_tcp_osmo_fd_unregister(const struct osmo_fd *fd)
By exposing struct stats_tcp_entry and using it as a param, you convert these functions from O(n) to O(k) because you can directly use llist_add, llist_del, etc.



-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/26454
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I1416f95aff2adcf13689646b7574845de169fa3d
Gerrit-Change-Number: 26454
Gerrit-PatchSet: 9
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-CC: fixeria <vyanitskiy at sysmocom.de>
Gerrit-Comment-Date: Thu, 16 Dec 2021 11:29:43 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211216/f95823d8/attachment.htm>


More information about the gerrit-log mailing list