From 420cd40c174c24db5c9267fa1d2bd63d176ecfc7 Mon Sep 17 00:00:00 2001 From: Oran Agra Date: Wed, 4 Nov 2020 09:53:43 +0200 Subject: [PATCH] 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 --- src/server.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server.c b/src/server.c index ffe2b6be6..a5aa64c77 100644 --- a/src/server.c +++ b/src/server.c @@ -4295,12 +4295,16 @@ sds genRedisInfoString(const char *section) { info = sdscatprintf(info, "# Clients\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_output_buffer:%zu\r\n" "blocked_clients:%d\r\n" "tracking_clients:%d\r\n" "clients_in_timeout_table:%llu\r\n", listLength(server.clients)-listLength(server.slaves), + getClusterConnectionsCount(), + server.maxclients, maxin, maxout, server.blocked_clients, server.tracking_clients,