mirror of
https://github.com/fluencelabs/redis
synced 2025-05-10 01:37:26 +00:00
Only incremnet stats for key miss/hit when the key is semantically accessed in read-only.
This commit is contained in:
parent
58bfbd1fa4
commit
29b3794231
11
src/db.c
11
src/db.c
@ -37,17 +37,22 @@ robj *lookupKey(redisDb *db, robj *key) {
|
||||
if (notify) handleClientsBlockedOnSwappedKey(db,key);
|
||||
}
|
||||
}
|
||||
server.stat_keyspace_hits++;
|
||||
return val;
|
||||
} else {
|
||||
server.stat_keyspace_misses++;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
robj *lookupKeyRead(redisDb *db, robj *key) {
|
||||
robj *val;
|
||||
|
||||
expireIfNeeded(db,key);
|
||||
return lookupKey(db,key);
|
||||
val = lookupKey(db,key);
|
||||
if (val == NULL)
|
||||
server.stat_keyspace_misses++;
|
||||
else
|
||||
server.stat_keyspace_hits++;
|
||||
return val;
|
||||
}
|
||||
|
||||
robj *lookupKeyWrite(redisDb *db, robj *key) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user