latency: add expire-del event (#8394)
This commit is contained in:
parent
4f6b8697e4
commit
a7d6105602
@ -53,15 +53,19 @@
|
|||||||
* to the function to avoid too many gettimeofday() syscalls. */
|
* to the function to avoid too many gettimeofday() syscalls. */
|
||||||
int activeExpireCycleTryExpire(redisDb *db, dictEntry *de, long long now) {
|
int activeExpireCycleTryExpire(redisDb *db, dictEntry *de, long long now) {
|
||||||
long long t = dictGetSignedIntegerVal(de);
|
long long t = dictGetSignedIntegerVal(de);
|
||||||
|
mstime_t expire_latency;
|
||||||
if (now > t) {
|
if (now > t) {
|
||||||
sds key = dictGetKey(de);
|
sds key = dictGetKey(de);
|
||||||
robj *keyobj = createStringObject(key,sdslen(key));
|
robj *keyobj = createStringObject(key,sdslen(key));
|
||||||
|
|
||||||
propagateExpire(db,keyobj,server.lazyfree_lazy_expire);
|
propagateExpire(db,keyobj,server.lazyfree_lazy_expire);
|
||||||
|
latencyStartMonitor(expire_latency);
|
||||||
if (server.lazyfree_lazy_expire)
|
if (server.lazyfree_lazy_expire)
|
||||||
dbAsyncDelete(db,keyobj);
|
dbAsyncDelete(db,keyobj);
|
||||||
else
|
else
|
||||||
dbSyncDelete(db,keyobj);
|
dbSyncDelete(db,keyobj);
|
||||||
|
latencyEndMonitor(expire_latency);
|
||||||
|
latencyAddSampleIfNeeded("expire-del",expire_latency);
|
||||||
notifyKeyspaceEvent(NOTIFY_EXPIRED,
|
notifyKeyspaceEvent(NOTIFY_EXPIRED,
|
||||||
"expired",keyobj,db->id);
|
"expired",keyobj,db->id);
|
||||||
signalModifiedKey(NULL, db, keyobj);
|
signalModifiedKey(NULL, db, keyobj);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user