From 5744c04d0ddb0d4001c443ded1167605646d49b6 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 13 Mar 2020 09:21:35 -0400 Subject: [PATCH] TT#76368 add port status to graphite output Change-Id: I7a12d55fd2e31222964361b301c6507b4e7760a5 --- daemon/graphite.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/daemon/graphite.c b/daemon/graphite.c index d56747467..6d72b8a9e 100644 --- a/daemon/graphite.c +++ b/daemon/graphite.c @@ -213,6 +213,20 @@ static int send_graphite_data(struct totalstats *sent_data) { GPF("deletes_ps_max %llu",(unsigned long long)ts->deletes_ps.ps_max); GPF("deletes_ps_avg %llu",(unsigned long long)ts->deletes_ps.ps_avg); + for (GList *l = all_local_interfaces.head; l; l = l->next) { + struct local_intf *lif = l->data; + // only show first-order interface entries: socket families must match + if (lif->logical->preferred_family != lif->spec->local_address.addr.family) + continue; + int num_ports = lif->spec->port_pool.max - lif->spec->port_pool.min + 1; + GPF("ports_free_%s_%s %i", lif->logical->name.s, + sockaddr_print_buf(&lif->spec->local_address.addr), + g_atomic_int_get(&lif->spec->port_pool.free_ports)); + GPF("ports_used_%s_%s %i", lif->logical->name.s, + sockaddr_print_buf(&lif->spec->local_address.addr), + num_ports - g_atomic_int_get(&lif->spec->port_pool.free_ports)); + } + ilog(LOG_DEBUG, "min_sessions:%llu max_sessions:%llu, call_dur_per_interval:%llu.%06llu at time %llu\n", (unsigned long long) ts->managed_sess_min, (unsigned long long) ts->managed_sess_max,