Add pubsubshard_channels field in INFO STATS (#10929)

We already have `pubsub_channels` and `pubsub_patterns`
in INFO stats, now add `pubsubshard_channels` (symmetry).

Sharded pubsub was added in #8621
This commit is contained in:
Binbin 2022-07-06 14:50:08 +08:00 committed by GitHub
parent 45ae605332
commit 0132ed7544
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -5661,6 +5661,7 @@ sds genRedisInfoString(dict *section_dict, int all_sections, int everything) {
"keyspace_misses:%lld\r\n"
"pubsub_channels:%ld\r\n"
"pubsub_patterns:%lu\r\n"
"pubsubshard_channels:%lu\r\n"
"latest_fork_usec:%lld\r\n"
"total_forks:%lld\r\n"
"migrate_cached_sockets:%ld\r\n"
@ -5710,6 +5711,7 @@ sds genRedisInfoString(dict *section_dict, int all_sections, int everything) {
server.stat_keyspace_misses,
dictSize(server.pubsub_channels),
dictSize(server.pubsub_patterns),
dictSize(server.pubsubshard_channels),
server.stat_fork_time,
server.stat_total_forks,
dictSize(server.migrate_cached_sockets),

View File

@ -1858,7 +1858,7 @@ struct redisServer {
dict *pubsub_patterns; /* A dict of pubsub_patterns */
int notify_keyspace_events; /* Events to propagate via Pub/Sub. This is an
xor of NOTIFY_... flags. */
dict *pubsubshard_channels; /* Map channels to list of subscribed clients */
dict *pubsubshard_channels; /* Map shard channels to list of subscribed clients */
/* Cluster */
int cluster_enabled; /* Is cluster enabled? */
int cluster_port; /* Set the cluster port for a node. */