Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
d1adc85a
Commit
d1adc85a
authored
Dec 13, 2016
by
antirez
Browse files
INFO: show num of slave-expires keys tracked.
parent
5b9ba264
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/expire.c
View file @
d1adc85a
...
@@ -334,6 +334,12 @@ void rememberSlaveKeyWithExpire(redisDb *db, robj *key) {
...
@@ -334,6 +334,12 @@ void rememberSlaveKeyWithExpire(redisDb *db, robj *key) {
dictSetUnsignedIntegerVal
(
de
,
dbids
);
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
/* 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
* 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.
* the same name/db and it is no longer a good idea to expire them.
...
...
src/server.c
View file @
d1adc85a
...
@@ -3008,7 +3008,8 @@ sds genRedisInfoString(char *section) {
...
@@ -3008,7 +3008,8 @@ sds genRedisInfoString(char *section) {
"pubsub_channels:%ld
\r\n
"
"pubsub_channels:%ld
\r\n
"
"pubsub_patterns:%lu
\r\n
"
"pubsub_patterns:%lu
\r\n
"
"latest_fork_usec:%lld
\r\n
"
"latest_fork_usec:%lld
\r\n
"
"migrate_cached_sockets:%ld
\r\n
"
,
"migrate_cached_sockets:%ld
\r\n
"
"slave_expires_tracked_keys:%zu
\r\n
"
,
server
.
stat_numconnections
,
server
.
stat_numconnections
,
server
.
stat_numcommands
,
server
.
stat_numcommands
,
getInstantaneousMetric
(
STATS_METRIC_COMMAND
),
getInstantaneousMetric
(
STATS_METRIC_COMMAND
),
...
@@ -3027,7 +3028,8 @@ sds genRedisInfoString(char *section) {
...
@@ -3027,7 +3028,8 @@ sds genRedisInfoString(char *section) {
dictSize
(
server
.
pubsub_channels
),
dictSize
(
server
.
pubsub_channels
),
listLength
(
server
.
pubsub_patterns
),
listLength
(
server
.
pubsub_patterns
),
server
.
stat_fork_time
,
server
.
stat_fork_time
,
dictSize
(
server
.
migrate_cached_sockets
));
dictSize
(
server
.
migrate_cached_sockets
),
getSlaveKeyWithExpireCount
());
}
}
/* Replication */
/* Replication */
...
...
src/server.h
View file @
d1adc85a
...
@@ -1734,6 +1734,7 @@ void activeExpireCycle(int type);
...
@@ -1734,6 +1734,7 @@ void activeExpireCycle(int type);
void
expireSlaveKeys
(
void
);
void
expireSlaveKeys
(
void
);
void
rememberSlaveKeyWithExpire
(
redisDb
*
db
,
robj
*
key
);
void
rememberSlaveKeyWithExpire
(
redisDb
*
db
,
robj
*
key
);
void
flushSlaveKeysWithExpireList
(
void
);
void
flushSlaveKeysWithExpireList
(
void
);
size_t
getSlaveKeyWithExpireCount
(
void
);
/* evict.c -- maxmemory handling and LRU eviction. */
/* evict.c -- maxmemory handling and LRU eviction. */
void
evictionPoolAlloc
(
void
);
void
evictionPoolAlloc
(
void
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment