summaryrefslogtreecommitdiff
path: root/src/expire.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2016-12-13 16:02:29 +0100
committerantirez <antirez@gmail.com>2016-12-13 16:02:29 +0100
commitd1adc85aa6f53424fec29751cec4bb3042a25359 (patch)
tree780c0bce1d108139c0bb7641ed7c84bf116d2616 /src/expire.c
parent5b9ba26403d6b275812301ada34675e0712e1f90 (diff)
downloadredis-d1adc85aa6f53424fec29751cec4bb3042a25359.tar.gz
INFO: show num of slave-expires keys tracked.
Diffstat (limited to 'src/expire.c')
-rw-r--r--src/expire.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/expire.c b/src/expire.c
index f590237b7..b05bf9f14 100644
--- a/src/expire.c
+++ b/src/expire.c
@@ -334,6 +334,12 @@ void rememberSlaveKeyWithExpire(redisDb *db, robj *key) {
dictSetUnsignedIntegerVal(de,dbids);
}
+/* Return the number of keys we are tracking. */
+size_t getSlaveKeyWithExpireCount(void) {
+ if (slaveKeysWithExpire == NULL) return 0;
+ return dictSize(slaveKeysWithExpire);
+}
+
/* Remove the keys in the hash table. We need to do that when data is
* flushed from the server. We may receive new keys from the master with
* the same name/db and it is no longer a good idea to expire them.