summaryrefslogtreecommitdiff
path: root/src/networking.c
diff options
context:
space:
mode:
authorjonnyomerredis <46671923+jonnyomerredis@users.noreply.github.com>2022-06-28 10:11:17 +0300
committerGitHub <noreply@github.com>2022-06-28 10:11:17 +0300
commit35c2ee8716dc9b1d4edbbb409815a585af491335 (patch)
tree6671e185faa9539adbb26faee074cd064a90e03e /src/networking.c
parent069b30a2b329102d60ba70bd3fd7a1d04284e426 (diff)
downloadredis-35c2ee8716dc9b1d4edbbb409815a585af491335.tar.gz
Add sharded pubsub keychannel count to client info (#10895)
When calling CLIENT INFO/LIST, and in various debug prints, Redis is printing the number of pubsub channels / patterns the client is subscribed to. With the addition of sharded pubsub, it would be useful to print the number of keychannels the client is subscribed to as well.
Diffstat (limited to 'src/networking.c')
-rw-r--r--src/networking.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/networking.c b/src/networking.c
index 8cace10d4..7d94c4808 100644
--- a/src/networking.c
+++ b/src/networking.c
@@ -2785,7 +2785,7 @@ sds catClientInfoString(sds s, client *client) {
}
sds ret = sdscatfmt(s,
- "id=%U addr=%s laddr=%s %s name=%s age=%I idle=%I flags=%s db=%i sub=%i psub=%i multi=%i qbuf=%U qbuf-free=%U argv-mem=%U multi-mem=%U rbs=%U rbp=%U obl=%U oll=%U omem=%U tot-mem=%U events=%s cmd=%s user=%s redir=%I resp=%i",
+ "id=%U addr=%s laddr=%s %s name=%s age=%I idle=%I flags=%s db=%i sub=%i psub=%i ssub=%i multi=%i qbuf=%U qbuf-free=%U argv-mem=%U multi-mem=%U rbs=%U rbp=%U obl=%U oll=%U omem=%U tot-mem=%U events=%s cmd=%s user=%s redir=%I resp=%i",
(unsigned long long) client->id,
getClientPeerId(client),
getClientSockname(client),
@@ -2797,6 +2797,7 @@ sds catClientInfoString(sds s, client *client) {
client->db->id,
(int) dictSize(client->pubsub_channels),
(int) listLength(client->pubsub_patterns),
+ (int) dictSize(client->pubsubshard_channels),
(client->flags & CLIENT_MULTI) ? client->mstate.count : -1,
(unsigned long long) sdslen(client->querybuf),
(unsigned long long) sdsavail(client->querybuf),