MEDIUM: stats: integrate static proxies stats in new stats
This is executed on startup with the registered statistics module. The
existing statistics have been merged in a list containing all
statistics for each domain. This is useful to print all available
statistics in a generic way.
Allocate extra counters for all proxies/servers/listeners instances.
These counters are allocated with the counters from the stats modules
registered on startup.
diff --git a/src/haproxy.c b/src/haproxy.c
index 0c1dd5a..49f3fbd 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -119,6 +119,7 @@
#include <haproxy/sock.h>
#include <haproxy/sock_inet.h>
#include <haproxy/ssl_sock.h>
+#include <haproxy/stats-t.h>
#include <haproxy/stream.h>
#include <haproxy/task.h>
#include <haproxy/thread.h>
@@ -2451,6 +2452,9 @@
free(cond);
}
+ EXTRA_COUNTERS_FREE(p->extra_counters_fe);
+ EXTRA_COUNTERS_FREE(p->extra_counters_be);
+
/* build a list of unique uri_auths */
if (!ua)
ua = p->uri_auth;
@@ -2593,6 +2597,7 @@
list_for_each_entry(srvdf, &server_deinit_list, list)
srvdf->fct(s);
+ EXTRA_COUNTERS_FREE(s->extra_counters);
free(s);
s = s_next;
}/* end while(s) */
@@ -2614,6 +2619,8 @@
LIST_DEL(&l->by_bind);
free(l->name);
free(l->counters);
+
+ EXTRA_COUNTERS_FREE(l->extra_counters);
free(l);
}