mirror of https://gerrit.osmocom.org/libosmocore
stats: use tcp stat names as provided
If an API user has defined a name for this particular stat, we should consider it unique and not append ip and port information from the connection. By appending ip and port information to all tcp stat names, we end up creating unique stat names every time a reconnection occurs and the source port changes. This makes the statistic impossible to track over time as it is continually using a different name. A quick example from the field over the course of a day: tcp.ipa-rsl-0,r=192.168.55.88.33056<->l=192.168.0.1.3003.tcp.rtt tcp.ipa-rsl-0,r=192.168.55.88.33311<->l=192.168.0.1.3003.tcp.rtt tcp.ipa-rsl-0,r=192.168.55.88.35510<->l=192.168.0.1.3003.tcp.rtt tcp.ipa-rsl-0,r=192.168.55.88.35958<->l=192.168.0.1.3003.tcp.rtt tcp.ipa-rsl-0,r=192.168.55.88.36110<->l=192.168.0.1.3003.tcp.rtt tcp.ipa-rsl-0,r=192.168.55.88.39269<->l=192.168.0.1.3003.tcp.rtt tcp.ipa-rsl-0,r=192.168.55.88.40394<->l=192.168.0.1.3003.tcp.rtt tcp.ipa-rsl-0,r=192.168.55.88.40397<->l=192.168.0.1.3003.tcp.rtt tcp.ipa-rsl-0,r=192.168.55.88.42920<->l=192.168.0.1.3003.tcp.rtt tcp.ipa-rsl-0,r=192.168.55.88.43839<->l=192.168.0.1.3003.tcp.rtt This change would treat tcp stats like other stats around the system. A unique name must be set by the API user. This would let us set a unique name like the following to avoid the situation above: bts.0.rsl.0.tcp.rtt Matching the existing rsl related stats: bts.0.rsl.delete_ind bts.0.rsl.ipa_nack bts.0.rsl.unknown ...they retain a constant name regardless of the underlying connectivity situation. Change-Id: Ib04c2f5bfcbd6c19dd87debf1fc053abf0b9bef2
This commit is contained in:
parent
b5551eec33
commit
a6d1ef0d60
|
@ -119,8 +119,7 @@ static void fill_stats(struct stats_tcp_entry *stats_tcp_entry)
|
||||||
|
|
||||||
/* Update statistics */
|
/* Update statistics */
|
||||||
if (stats_tcp_entry->name)
|
if (stats_tcp_entry->name)
|
||||||
snprintf(stat_name, sizeof(stat_name), "%s,%s", stats_tcp_entry->name,
|
snprintf(stat_name, sizeof(stat_name), "%s", stats_tcp_entry->name);
|
||||||
osmo_sock_get_name2(stats_tcp_entry->fd->fd));
|
|
||||||
else
|
else
|
||||||
snprintf(stat_name, sizeof(stat_name), "%s", osmo_sock_get_name2(stats_tcp_entry->fd->fd));
|
snprintf(stat_name, sizeof(stat_name), "%s", osmo_sock_get_name2(stats_tcp_entry->fd->fd));
|
||||||
osmo_stat_item_group_set_name(stats_tcp_entry->stats_tcp, stat_name);
|
osmo_stat_item_group_set_name(stats_tcp_entry->stats_tcp, stat_name);
|
||||||
|
|
Loading…
Reference in New Issue