diff --git a/doc/management.txt b/doc/management.txt index 83c7a3439..5edfaab9c 100644 --- a/doc/management.txt +++ b/doc/management.txt @@ -1025,6 +1025,7 @@ S (Servers). 73. addr [L..S]: address:port or "unix". IPv6 has brackets around the address. 74: cookie [..BS]: server's cookie value or backend's cookie name 75: mode [LFBS]: proxy mode (tcp, http, health, unknown) + 76: algo [..B.]: load balancing algorithm 9.2. Unix Socket commands diff --git a/src/dumpstats.c b/src/dumpstats.c index 504bba1de..386c46440 100644 --- a/src/dumpstats.c +++ b/src/dumpstats.c @@ -336,6 +336,7 @@ enum stat_field { ST_F_ADDR, ST_F_COOKIE, ST_F_MODE, + ST_F_ALGO, /* must always be the last one */ ST_F_TOTAL_FIELDS @@ -422,6 +423,7 @@ const char *stat_field_names[ST_F_TOTAL_FIELDS] = { [ST_F_ADDR] = "addr", [ST_F_COOKIE] = "cookie", [ST_F_MODE] = "mode", + [ST_F_ALGO] = "algo", }; /* one line of stats */ @@ -3751,7 +3753,7 @@ static int stats_dump_fields_html(const struct field *stats, int admin, unsigned if (flags & ST_SHLGNDS) { /* balancing */ chunk_appendf(&trash, "
balancing: %s", - backend_lb_algo_str(px->lbprm.algo & BE_LB_ALGO)); + field_str(stats, ST_F_ALGO)); /* cookie */ if (stats[ST_F_COOKIE].type) { @@ -4346,9 +4348,11 @@ static int stats_dump_be_stats(struct stream_interface *si, struct proxy *px, in stats[ST_F_TYPE] = mkf_u32(FO_CONFIG|FS_SERVICE, STATS_TYPE_BE); stats[ST_F_RATE] = mkf_u32(0, read_freq_ctr(&px->be_sess_per_sec)); stats[ST_F_RATE_MAX] = mkf_u32(0, px->be_counters.sps_max); + if (flags & ST_SHLGNDS) { if (px->cookie_name) stats[ST_F_COOKIE] = mkf_str(FO_CONFIG|FN_NAME|FS_SERVICE, px->cookie_name); + stats[ST_F_ALGO] = mkf_str(FO_CONFIG|FS_SERVICE, backend_lb_algo_str(px->lbprm.algo & BE_LB_ALGO)); } /* http response: 1xx, 2xx, 3xx, 4xx, 5xx, other */