From d01acfcc75a6c5798a95a8ccca9be18eba65a0bf Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Mon, 26 Oct 2015 16:22:45 +0100 Subject: stats: Support statsd Multi-Metric Packets If the MTU is given, combine several messages into a single UDP packet until the limit is reached. Flush all reporters after the values have been scanned. New vty commands (node config-stats): mtu <100-65535> Enable multi-metric packets and set the maximum packet size (in byte) no mtu Disable multi-metric packets Note that single messages that are longer than the given MTU (minus 28 octets protocol overhead) will be dropped. Sponsored-by: On-Waves ehf --- include/osmocom/core/stats.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/osmocom/core/stats.h b/include/osmocom/core/stats.h index 489e0e41..ed461ddc 100644 --- a/include/osmocom/core/stats.h +++ b/include/osmocom/core/stats.h @@ -22,6 +22,8 @@ #include #include +struct msgb; + enum stats_reporter_type { STATS_REPORTER_STATSD, }; @@ -45,6 +47,8 @@ struct stats_reporter { struct sockaddr bind_addr; int bind_addr_len; int fd; + struct msgb *buffer; + int agg_enabled; struct llist_head list; }; @@ -71,6 +75,7 @@ struct stats_reporter *stats_reporter_find(enum stats_reporter_type type, int stats_reporter_set_remote_addr(struct stats_reporter *srep, const char *addr); int stats_reporter_set_remote_port(struct stats_reporter *srep, int port); int stats_reporter_set_local_addr(struct stats_reporter *srep, const char *addr); +int stats_reporter_set_mtu(struct stats_reporter *srep, int mtu); int stats_reporter_set_name_prefix(struct stats_reporter *srep, const char *prefix); int stats_reporter_enable(struct stats_reporter *srep); int stats_reporter_disable(struct stats_reporter *srep); -- cgit v1.2.3