MINOR: stats: indicate the number of servers in a backend's status
authorWilly Tarreau <w@1wt.eu>
Fri, 23 Oct 2020 16:02:54 +0000 (18:02 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 23 Oct 2020 16:11:30 +0000 (18:11 +0200)
commit2fbe6940f4cce550928fd665df4a48b9d0df99b5
tree3e1df4dbd86bd6bd07436742a86c7a8671d9c80f
parent3e320367014c742814ba494594cdb8340b1161f1
MINOR: stats: indicate the number of servers in a backend's status

When dumping the stats page (or the CSV output), when many states are
mixed, it's hard to figure the number of up servers. But when showing
only the "up" servers or hiding the "maint" servers, there's no way to
know how many servers are configured, which is problematic when trying
to update server-templates.

What this patch does, for dumps in "up" or "no-maint" modes, is to add
after the backend's "UP" or "DOWN" state "(%d/%d)" indicating the number
of servers seen as UP to the total number of servers in the backend. As
such, seeing "UP (33/39)" immediately tells that there are 6 servers that
are not listed when using "up", or will let the client figure how many
servers are left once deducted the number of non-maintenance ones. It's
not done on default dumps so as not to disturb existing tools, which
already have all the information they need in the dump.
src/stats.c