diff --git a/src/server.c b/src/server.c index 1baa044be..f2f5c8b3f 100644 --- a/src/server.c +++ b/src/server.c @@ -4281,6 +4281,7 @@ sds genRedisInfoString(const char *section) { "active_defrag_key_misses:%lld\r\n" "tracking_total_keys:%lld\r\n" "tracking_total_items:%lld\r\n" + "tracking_total_prefixes:%lld\r\n" "unexpected_error_replies:%lld\r\n", server.stat_numconnections, server.stat_numcommands, @@ -4311,6 +4312,7 @@ sds genRedisInfoString(const char *section) { server.stat_active_defrag_key_misses, (unsigned long long) trackingGetTotalKeys(), (unsigned long long) trackingGetTotalItems(), + (unsigned long long) trackingGetTotalPrefixes(), server.stat_unexpected_error_replies); } diff --git a/src/server.h b/src/server.h index af435b148..9c2b761c4 100644 --- a/src/server.h +++ b/src/server.h @@ -1695,6 +1695,7 @@ void trackingInvalidateKeysOnFlush(int dbid); void trackingLimitUsedSlots(void); uint64_t trackingGetTotalItems(void); uint64_t trackingGetTotalKeys(void); +uint64_t trackingGetTotalPrefixes(void); void trackingBroadcastInvalidationMessages(void); /* List data type */ diff --git a/src/tracking.c b/src/tracking.c index 48d231627..a995817e2 100644 --- a/src/tracking.c +++ b/src/tracking.c @@ -518,3 +518,8 @@ uint64_t trackingGetTotalKeys(void) { if (TrackingTable == NULL) return 0; return raxSize(TrackingTable); } + +uint64_t trackingGetTotalPrefixes(void) { + if (PrefixTable == NULL) return 0; + return raxSize(PrefixTable); +}