Add maxclients and cluster_connections to INFO CLIENTS (#7979)

Few config settings are also reflected by the INFO command.
these are mainly ones that are important for either an instant view of
the server status (to compare a metric to it's limit config),
Important configurations that are necessary in the crash log (which
currently doesn't print the config),
And things that are important for monitoring solutions (such as
Prometheus), which rely on INFO to collect their data.

Add cluster_connections to INFO CLUSTER:
This makes it possible to be combined together with connected_clients
and connected_slaves and be matched against maxclients
This commit is contained in:
Oran Agra 2020-11-04 09:53:43 +02:00 committed by GitHub
parent 89c78a9808
commit a698a6391a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4295,12 +4295,16 @@ sds genRedisInfoString(const char *section) {
info = sdscatprintf(info, info = sdscatprintf(info,
"# Clients\r\n" "# Clients\r\n"
"connected_clients:%lu\r\n" "connected_clients:%lu\r\n"
"cluster_connections:%lu\r\n"
"maxclients:%u\r\n"
"client_recent_max_input_buffer:%zu\r\n" "client_recent_max_input_buffer:%zu\r\n"
"client_recent_max_output_buffer:%zu\r\n" "client_recent_max_output_buffer:%zu\r\n"
"blocked_clients:%d\r\n" "blocked_clients:%d\r\n"
"tracking_clients:%d\r\n" "tracking_clients:%d\r\n"
"clients_in_timeout_table:%llu\r\n", "clients_in_timeout_table:%llu\r\n",
listLength(server.clients)-listLength(server.slaves), listLength(server.clients)-listLength(server.slaves),
getClusterConnectionsCount(),
server.maxclients,
maxin, maxout, maxin, maxout,
server.blocked_clients, server.blocked_clients,
server.tracking_clients, server.tracking_clients,