MINOR: proxy: add 'served' field to proxy, equal to total of all servers'
This will allow lb_chash to determine the total active sessions for a
proxy without any computation.
Signed-off-by: Andrew Rodland <andrewr@vimeo.com>
diff --git a/src/stream.c b/src/stream.c
index 151bcb0..738a23c 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -2515,6 +2515,7 @@
if (sess->srv_conn) {
sess->srv_conn->served--;
+ sess->srv_conn->proxy->served--;
if (sess->srv_conn->proxy->lbprm.server_drop_conn)
sess->srv_conn->proxy->lbprm.server_drop_conn(sess->srv_conn);
stream_del_srv_conn(sess);
@@ -2522,6 +2523,7 @@
if (newsrv) {
newsrv->served++;
+ newsrv->proxy->served++;
if (newsrv->proxy->lbprm.server_take_conn)
newsrv->proxy->lbprm.server_take_conn(newsrv);
stream_add_srv_conn(sess, newsrv);